Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change file header #118

Closed
koppor opened this issue Aug 21, 2015 · 19 comments
Closed

Change file header #118

koppor opened this issue Aug 21, 2015 · 19 comments
Milestone

Comments

@koppor
Copy link
Member

koppor commented Aug 21, 2015

Currently, JabRef adds following header to each BibTeX file

% This file was created with JabRef <version>
% Encoding: UTF8

If users use different versions of JabRef, this causes problems. Therefore, I propose to just remove the first header line.

I'm not sure about the second line. Should we guess the encoding from the file or keep the encoding information?

Other JabRef settings such as the group information or the save order is stored in BibTeX @comment entries. Maybe we should require the encoding also be stored as @comment? Possibly, this interferes with the parser and we have to first check existence of a encoding comment entry and then fire up the parser.

@stefan-kolb
Copy link
Member

  1. The first line doesn't really add any benefit for the user so it could be removed. The only argument against it is that it is an implicit advertisment for our tool, so we could just change it to `Created with JabRef bibliography manager´ or alike.
  2. We should get the encoding of the file directly from the file header if possible.

@koppor
Copy link
Member Author

koppor commented Aug 21, 2015

As new user in the BibTeX world one might think that this line is important that JabRef can deal with it. Since all most pages about latex and bibtex recommend JabRef, I vote for completely dropping the line - even though some completely new users are not directly guided to JabRef.

@mlep
Copy link
Contributor

mlep commented Aug 21, 2015

Specifically for new users thinking such a line is important, I suggest to add
% Go to <http://> and give money to JabRef
;-)

@lenhard
Copy link
Member

lenhard commented Aug 24, 2015

I'll vote for dropping the line completely as well.

@bluebirch
Copy link

Add the first line as

-- coding: utf-8 --

which actually makes sense in many text editors.

mån 24 aug 2015 11:59 Jörg Lenhard notifications@github.com skrev:

I'll vote for dropping the line completely as well.


Reply to this email directly or view it on GitHub
#118 (comment).

@lenhard
Copy link
Member

lenhard commented Aug 24, 2015

Ok, @bluebirch has a point. We could just switch to a standard notation for specifying the encoding.

I don't really know what the most widely used notation for specifying the encoding is, so if no one objects, -*- coding: utf-8 -*- would be fine by me.

@koppor
Copy link
Member Author

koppor commented Aug 24, 2015

  • TeXstudio: % !TEX encoding = UTF-8 Unicode
  • AUCTeX: %%% coding: utf-8
  • BibDesk: %% Saved with string encoding Unicode (UTF-8)

I don't know about Zotero and other bibtex managers.

@bluebirch Could you name some of the "many text editors"? Would be nice to have a justified decision as we don't want to change that line the next years. 😀

@stefan-kolb
Copy link
Member

-*- coding: utf-8 -*- think this is only Emacs and Python. As far as I know there is no standard way of defining file encodings.

@bluebirch
Copy link

You might be right. As a former Emacs user, I see the world differently.
But I'm slowly adapting to a new reality with Sublime Text. ;-)

@stefan-kolb
Copy link
Member

@koppor
Copy link
Member Author

koppor commented Aug 24, 2015

I really like some auto-detection, which frees the user to configure its programs.

@koppor
Copy link
Member Author

koppor commented Aug 24, 2015

We can also go for supporting UTF-8 only to have the .bib file really portable across different systems. Other encodings can be converted to UTF-8 by JabRef while loading.

@matthiasgeiger
Copy link
Member

Just stumbled over this - However, I don't have the time to dig deeper in the matter, but the first line seems to have some purpose ;-)

@stefan-kolb
Copy link
Member

Yes there is still one migration based on the JabRef version.
We can remove the file header though.
We just need to keep the logic for parsing the old header possibly...
See FileLinksUpgradeWarning.java

@stefan-kolb
Copy link
Member

This commit 4558fb6 removes the JabRef version file header.
We need to come up with a good solution for the encoding though.
Backwards compatibility is tested and retained in this commit. We could remove quite some code if this can be made obsolete.

@stefan-kolb stefan-kolb added v3 and removed v2 labels Aug 25, 2015
@stefan-kolb stefan-kolb added this to the v2.80 milestone Sep 17, 2015
@lenhard
Copy link
Member

lenhard commented Sep 18, 2015

The encoding name is now written as "UTF-8", see also #155
The old "UTF8" is automatically overwritten when the file is saved.

@lenhard
Copy link
Member

lenhard commented Sep 21, 2015

How about settling with the current status quo for now:

% Encoding: UTF-8

and closing this issue? Any objections?

@koppor
Copy link
Member Author

koppor commented Sep 21, 2015

Fine with me. The other encoding strings are not convincing.

@matthiasgeiger
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants