On Sep 29, 2014, at 15:51, Adam R. Maxwell wrote:

> 
>> On Sep 29, 2014, at 02:13 , Christiaan Hofman <cmhof...@gmail.com> wrote:
>> 
>> When I test this, it uses the encoding from the popup.
>> 
>> The way it works now is that the encoding from the popup is set as a the 
>> lastSelectedEncoding ivar in -[BDSKDocumentController 
>> runModalOpenPanel:forTypes:], and it is set in the document in -[BibDocument 
>> init]. This is the encoding used when reading in -[BibDocument 
>> readFromURL:ofType:error:]. That's the process used by TextEdit.
> 
> OK, I missed that last night. Seems like it should work, but I see a lot of 
> UTF-8 conversion errors listed in the error panel, regardless of the encoding 
> I choose. If I change the default encoding to Mac Roman, those errors go 
> away. 
> 
> With some logging, it looks like openDocument: returns before -[BibDocument 
> init] is called.
> 
> 2014-09-29 06:45:20.346 BibDesk[8145:1863653] -[BDSKDocumentController init] 
> encoding = -1
> 2014-09-29 06:45:49.586 BibDesk[8145:1863653] -[BDSKDocumentController 
> runModalOpenPanel:forTypes:] encoding = 30
> 2014-09-29 06:45:49.588 BibDesk[8145:1863653] -[BDSKDocumentController 
> openDocument:] encoding = -1
> 2014-09-29 06:45:49.615 BibDesk[8145:1863653] -[BDSKDocumentController 
> lastSelectedEncoding] encoding = -1
> 2014-09-29 06:45:49.615 BibDesk[8145:1863653] -[BibDocument init] encoding = 4
> 
> I can check in my logs if you want to run exactly the same thing; not sure 
> what OS you’re using. This is on Yosemite, but if anything has changed, it’s 
> more likely during the 10.7 NSDocument rewrite.
> 
> Adam

I have rewritten the code a bit, saving the open panel options by URL and 
resetting the option in openDocumentWithContentsOfURL:.. I think it should now 
work again. Could you test this out with the current code?

Christiaan

------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Bibdesk-develop mailing list
Bibdesk-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to