Closed
Bug 129736
Opened 22 years ago
Closed 18 years ago
Saving of file with a charset different from system locale fails without an error
Categories
(Core :: Internationalization, defect, P2)
Tracking
()
RESOLVED
WORKSFORME
mozilla1.0.1
People
(Reporter: marina, Assigned: jshin1987)
References
Details
(Keywords: intl, regression, Whiteboard: adt3)
*** observed with 2002-03-08 build *** in the trunk builds when saving a file (image or html) with a name different form the system default (say giving a ja name while on english system) your saving operation fails without a warning or error message. This is not a behavior of 6.2.1. When such an operartion fails the error message pops up "saving of file failed" and you are returned to the Save as dlgbox. This makes sense to the user and he undrestands that this is not a legitimate operation, so the way the current builds behave is a regression.
Comment 2•22 years ago
|
||
marina: when do we start seeing this bug? adding nsbeta1
Status: NEW → ASSIGNED
Keywords: nsbeta1
Comment 3•22 years ago
|
||
This might be related to the xpcom native converter change, cc to alecf.
Comment 4•22 years ago
|
||
I don't believe we actually changed any actual behavior with the nsLocalFile* changes. Also, the change hasn't landed on linux yet.. what platform are we seeing this on? more than likely, someone is using the non-unicode API when they should be using the unicode API. The non-unicode api assumes that the incoming string is in the system charset. If the non-unicode API is being called across a JavaScript boundary, the unicode bytes will simply be chopped from a 16-bit character to an 8-bit character without any conversion. I think more debugging is in order. Find out who is calling setLeafName or setLeafNameUnicode
<I don't believe we actually changed any actual behavior with the nsLocalFile* changes. Also, the change hasn't landed on linux yet.. what platform are we seeing this on? - am seeing this on Mac OS and Windows
Comment 6•22 years ago
|
||
Note this only happens when you save with a filename which is different from the system's defult. We expect to have a conversion error for that case. I think we used to fallback to '?' if the conversion fails. For WideCharToMultiByte, it has a flag, "WC_DEFAULTCHAR Replace exceptions with the default character during conversion." I think we need to set that flag.
Comment 7•22 years ago
|
||
I tried this with my debug build. Saved as a Japanese file name on English system. In nsLocalFileWin.cpp, WideCharToMultiByte actually mapps the unconverted characters to '?'. So, the problem is in somewhere else.
Comment 8•22 years ago
|
||
nsbeta1+, we should show a warning for file name that we cannot handle. Both Excel and WinZip do not handle Unicode file name but they DO show warning
Comment 9•22 years ago
|
||
More info.: I tried to same a Japanese file name through comopser on SimpChinese WinXP. N6.2.1: the file name shows fine and can be saved. Recent trunk build: the file name will show as ".....html" but still can be saved.
Reporter | ||
Comment 10•22 years ago
|
||
in today's build i get a warning while saving an html file with the name different from system encoding, but i don't get any warning for the image file.
Comment 11•22 years ago
|
||
Marina, Roy, or someone else: Could you give me a more detailed example to test on my Macintosh build? What site should I go to? Thanks!
Reporter | ||
Comment 12•22 years ago
|
||
Try those steps:(win2k EN) - go to netscape.com site; - select an image and save it as an image with ja or cyrillic or any other charset different from Western-8859-1; - note: there was no warning, the file is not saved and it just fails.
Comment 13•22 years ago
|
||
adt3 P2
Priority: -- → P2
Whiteboard: adt3
Target Milestone: --- → mozilla1.0
Comment 14•22 years ago
|
||
marina: I tried to saving img file; but it displays an error. (saving korean.filename in W2K-Japanaese) Please try again.
Reporter | ||
Comment 15•22 years ago
|
||
yes,saving the image file is working now ( i mean you do get an error). But try to save a web page: try this: http://www.time.com/time/covers/1101020401/fallen.html. First save it as "fallen"- you'll see the fallen.html in the dir you specified. Then try "יייי" on the english system; it works too, you'll get 'יייי.html". But if you'll try to save with "cyrillicname.html" you won't get any error message and no file with the given name will appear (even with ????) in the directory.
Comment 16•22 years ago
|
||
Impact Summery Impact Platform: windows only Impact language users: ALL 560M 100% of internet users Probability of hitting the problem: LOW, users less seldom to use characters not in their locale. Severity if hit the problem in the worst case: File not saved. data lost without warning. Way of recover after hit the problem: save again with different file name. Risk of the fix: unknown Potential benefit of fix this problem: unknown
Comment 17•22 years ago
|
||
I am considering nsbeta1- this one.
Comment 18•22 years ago
|
||
this will only happen when the users use some characters that are not part of the system locale charset. nsbeta1-
Comment 19•22 years ago
|
||
making off my radar. -> 1.0.1 milestone
Target Milestone: mozilla1.0 → mozilla1.0.1
Assignee | ||
Updated•20 years ago
|
Assignee | ||
Comment 20•18 years ago
|
||
This doesn't fail. Instead, characters outside the current locale is replaced with '_'. That's bug 359148.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•