Closed Bug 129736 Opened 24 years ago Closed 19 years ago

Saving of file with a charset different from system locale fails without an error

Categories

(Core :: Internationalization, defect, P2)

x86
Windows 2000
defect

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.
added keywords
Keywords: intl, regression
marina: when do we start seeing this bug? adding nsbeta1
Status: NEW → ASSIGNED
Keywords: nsbeta1
This might be related to the xpcom native converter change, cc to alecf.
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
OS: All → Windows 2000
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.
QA Contact: ruixu → ylong
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.
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
Keywords: nsbeta1nsbeta1+
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.
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.
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!
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.
adt3 P2
Priority: -- → P2
Whiteboard: adt3
Target Milestone: --- → mozilla1.0
marina: I tried to saving img file; but it displays an error. (saving korean.filename in W2K-Japanaese) Please try again.
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.
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
I am considering nsbeta1- this one.
this will only happen when the users use some characters that are not part of the system locale charset. nsbeta1-
Keywords: nsbeta1+nsbeta1-
making off my radar. -> 1.0.1 milestone
Target Milestone: mozilla1.0 → mozilla1.0.1
Assignee: yokoyama → jshin
Status: ASSIGNED → NEW
Depends on: 162361
This doesn't fail. Instead, characters outside the current locale is replaced with '_'. That's bug 359148.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.