|
Post by Sedoj on Feb 20, 2006 17:39:30 GMT -5
I use NAV. This extensions works fine with english filenames. But it works wrong with russian file names (and I think with other non-latin languages too). For example: I save html "Corba Глава 1.htm" and NAV shows dialog with message "Unable to open the file G:\Corba ;020 1.htm. Please make sure the file exists on your system and the path and filename are correct." Russian "Глава" converts to the hex "13 3B 30 32 30". And sure NAV can not find such file. Could you fix it?
|
|
|
Post by Devon J on Feb 24, 2006 13:41:44 GMT -5
I'm not sure how I would fix this, but I'll put it on my list of things to look at, thanks
|
|
|
Post by Sedoj on Mar 7, 2006 14:11:56 GMT -5
I found workaround for this bug. This isn't solution, just workaround for me. In file downscan.jar:content\downscan\downscanoverlay.js after if(wm.getMostRecentWindow("navigator:browser") != window) { // Only want this executed once, so only do it with the most recent browser window return; } I add
charset = "windows-1251" //russian Windows charset try { var uniConv = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'] .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); uniConv.charset = charset; data = uniConv.ConvertFromUnicode(elmpath); } catch(e) { d(e); //I uncomment d() at the end }
elmpath = data
And it seems that it works. But I have no idea have to make it suitable for all languages.
|
|
|
Post by Devon J on Mar 7, 2006 21:21:37 GMT -5
Hey, nice work. I've found the firefox preference for the default charset and attempted to make it work for anyone. Could you try this code and see if it works for russian filenames (and latin?) I must confess I don't really know much about charsets and the like, but if this works, I'll add it to the extension.
try { var defCharset = db_pref.getComplexValue("intl.charset.default", Components.interfaces.nsIPrefLocalizedString).data; var uniConv = Components.classes['@mozilla.org/intl/scriptableunicodeconverter'] .createInstance(Components.interfaces.nsIScriptableUnicodeConverter); uniConv.charset = defCharset; var convertedPath = uniConv.ConvertFromUnicode(elmpath); elmpath = convertedPath; } catch(e) {}
|
|
|
Post by Sedoj on Mar 8, 2006 5:57:24 GMT -5
Yes, it seems that it works. I try to save page from russian search engine Yandex (ya.ru). They name themself "Яndex" first letter is russian and other is latin. And my NAV scans this file and says that all OK. So for me it works.
|
|