locale: zh-CN.UTF-8 Steps to reproduce: 1)Launch #thunderbird 2)Create a New Contact from File->New->Address Book Contact 3)Input the contact details and in Photo tab select a localized image file in "On this computer" field Result: Localized image filename is garbled in this field
Created attachment 515570 [details] [diff] [review] set filefield label to path name explicitly
Assignee: nobody → brian.lu
Attachment #515570 - Flags: review?(bugzilla)
Comment on attachment 515570 [details] [diff] [review] set filefield label to path name explicitly Whilst this works around the issue, I'm not convinced it is the correct fix. The really issue appears to be here: http://hg.mozilla.org/mozilla-central/annotate/1240004b90e6/toolkit/content/widgets/filefield.xml#l71 nsIURL.fileName may contain escaped characters. So if we don't want to display escaped characters I think that is the place where it looks like we should fix it. Fixing the core issue would also fix the case where we're re-opening the dialog, which this patch currently misses.
Attachment #515570 - Flags: review?(bugzilla) → review-
Looks like this is a bug in the <filefield> implementation - it gets the name by converting the file to a URL (!) which encodes non-ascii characters.
Looks like the code did this ever since Ben's first check in 6 years ago.
Created attachment 519343 [details] [diff] [review] fix in filefield
Comment on attachment 519343 [details] [diff] [review] fix in filefield >+ let lf = aFile.QueryInterface(Components.interfaces.nsILocalFile); You don't need nsILocalFile; path is an attribute on nsIFile. Also newFileURI will already fail if aFile isn't an nsIFile, so you don't need both cases. >+ return lf.path; Did you mean the whole path? I would have thought the leafName would suffice (leafName is also an attribute on nsIFile of course).
Attachment #519343 - Flags: review?(neil) → review-
Created attachment 519582 [details] [diff] [review] using nsIFile.leafName
As this is really a bug in toolkit, moving to the toolkit product.
Component: Address Book → XUL Widgets
Product: Thunderbird → Toolkit
QA Contact: address-book → xul.widgets
Summary: [thunderbird]file name is garbled in Photo tab of a contact → fileField can display non-ascii characters incorrectly (In Thunderbird, the file name is garbled in Photo tab of a contact)
You need to log in before you can comment on or make changes to this bug.