On 22 Aug 2008, at 12:20 AM, James Howison wrote: > > On Aug 21, 2008, at 5:38 PM, Christiaan Hofman wrote: > >> >> On 21 Aug 2008, at 11:18 PM, James Howison wrote: >> >>> >>> On Aug 21, 2008, at 4:28 PM, Maxwell, Adam R wrote: >>> >>>> On 08/21/08 12:34, "James Howison" <[EMAIL PROTECTED]> wrote: >>>> >>>>> PLOS is publishing their bibtex in utf8 (as a downloaded .bib >>>>> file). >>>>> Which is fine, if one opens the file with utf8 encoding. However >>>>> when >>>>> I double click it, BibDesk (1.3.18) gives the "Unable to parse >>>>> string >>>>> as BibTeX" error, which suggests editing, but not trying a >>>>> different >>>>> encoding. >>>> >>>> Try dropping the file on your document's main window, which I >>>> should >>>> have >>>> suggested to JT as well. That will force BibDesk to guess the >>>> encoding, and >>>> UTF-8 will be tried if the file does not have a Unicode BOM (unless >>>> that's >>>> changed in the last few months). Double-clicking the file only >>>> uses >>>> your >>>> default encoding. >>> >>> Dropping the file I linked to does import the entry, but it >>> produces a >>> different (wrong) result (the umlauted i char is messed up) than >>> using >>> the open-with encoding option. >> >> It probably used Unicode, because that's tried before UTF-8. Shows my >> point that you can't just trust it only because it didn't fail. >> >>> >>>>> I just wondered whether bibdesk ought to be able to assess the >>>>> encoding of the file (TextMate seems to be able to), or whether >>>>> this >>>>> error message might suggest trying a different encoding? >>>> >>>> TextMate always tries UTF-8; since a file can't be misinterpreted >>>> as >>>> UTF-8, >>>> this is safe (BibDesk does it as well, in the case I mentioned >>>> above). >>>> Unfortunately, to try and guess encoding when opening a BibTeX >>>> document from >>>> the Finder would be problematic with BibDesk's error display, among >>>> other >>>> things, so it has to be specified by the user. >>> >>> Christiaan wrote: >>> >>>> If you have set ASCII as the default encoding in the Files prefs, >>>> you >>>> can change that to UTF-8. If you get a warning when opening a file >>>> that was saved with ASCII encoding, you can safely ignore that. >>> >>> Yes, that works, the file now opens with a double click (and the ï >>> char shows up properly). >>> >>>> BibDesk could try to guess the encoding of the file, but that would >>>> be >>>> wrong and lying to you. With lots of bad consequences, including >>>> files >>>> that may not save. Note that being able to open a file with a >>>> particular encoding is no guarantee that that's the right one. And >>>> if >>>> it isn't, you will have messed up text without knowing it, and you >>>> probably won't be able to save the file. That's why BibDesk always >>>> either fails or warns. Also note that, unlike TextMate, you don't >>>> really see the plain text that's downloaded. >>>> >>>> Note that you can also use the Open... menu item to open a file >>>> with a >>>> particular encoding. >>> >>> Perhaps the error display dialog could simply suggest "You could try >>> opening this file with a different encoding"? >>> >>> The current message is: >>> >>> "There was a problem reading the file. Do you want to give up, edit >>> the file to correct the errors, or keep going with everything that >>> could be analyzed?" >>> >>> I suggest: >>> >>> "There was a problem reading the file. Do you want to give up, edit >>> the file to correct the errors, keep going with everything that >>> could >>> be analyzed, or try to open the file after specifying a different >>> encoding?" >>> >>> and adding an "Open With Encoding" button, which goes to the regular >>> Open dialog box. >>> >>> --J >> >> We can't offer that option, as the document has already failed at >> that >> point. At that point there's no way back to try again. (well, there >> might be by completely rewriting the document based architecture, >> that's not an option). > > It's not possible to open a file dialog with that file selected? Fair > enough, well, maybe just a note? >
The message is already pretty long and complex. > btw, PLOS is asking me (I reported a bug) is they could write a BOM > mark or something to make the encoding detectable for double click > opening? > > --J BOM is only for Unicode. There is no general way to note an encoding. Encodings is a pretty stupid system, I'm sure if it were to be designed from scratch it would be very different. Christiaan ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Bibdesk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bibdesk-users
