Closed Bug 26938 Opened 26 years ago Closed 26 years ago

nsconv misconverts "\" in.properties files to "\\"

Categories

(Core :: Internationalization, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: momoi, Assigned: ftang)

References

Details

(Whiteboard: [nsbeta2-][nsbeta3+])

** Observed with nsconv with 2/7/2000 Win32 build ** This problem was reported by Kazu Yamamoto (JLP member). If you have the following kind of line in .properties file, \t\r\n\f which is not unusual in either in Shift_JIS file or US-ASCII encoding for this type of file, and if you use "nsconv" to do conversion of the following type, nsconv -f US-ASCII -t x-u-escaped file1.properties file2.properties nsconv -f Shift_JIS -t x-u-escaped file1.properties file2.properties In either case, the "\t\r\n\f" gets turned into "\\t\\r\\n\\f". This does not seem to be a correct result. Reversing the conversion, i.e. from x-u-escaped to Shift_JIS on file2.properties does not eliminate the extra "\". Kazu reports that 'native2ascii' does not have this kind of problem. This would be a big problem when localizers use nsconv for .properties file conversion since they convert back from x-u-escaped files to SJIS and do revisions and convert back to x-uescaped, and they repeat this process "\" will multiply.
ok, what should we do now. I propose we do the following from x-u-escaped to others- \n \t \' \\ \" -> \n \t \' \\ \" from others to x-u-escaped- \n \t \' \\ \" -> \n \t \' \\ \"
Status: NEW → ASSIGNED
Summary: nsconv miconverts "\" in.properties files to "\\" → nsconv miconverts "\" in.properties files to "\\"
easy fix
Target Milestone: M14
This is not easy as we thought. If we convert "\" to "\" from unicode to x-u-escaped, then "\uxxxx" in unicode will be converted to "\uxxxx" in x-u-escaped. However, when it convert back to unicode, it will be convert to one character U+xxxx . If we convert "\" to "\\" from unicode to x-u-escaped, then "\uxxxx" in unicode will be converted to "\\uxxxx" which will do the right thing. however, that mean we need to convert "\\" to "\" from x-u-escaped to unicode.
What is the Java spec for handling '\'. Is it considered regular 7-bin ASCII or a meta character? What does native2ascii do?
Please refer to this excerpt from Java Language Spec: "Within the element string (but not the key), the ASCII escape sequences \t, \n, \r, \\, \", \', \ (a backslash and a space), and \uxxxx are recognized and converted to single characters. Moreover, if the last character on the line is \, then the next line is treated as a continuation of the current line; the \ and line terminator are simply discarded, and any leading whitespace characters on the continuation line are also discarded and are not part of the element string." See bug 21418.
Blocks: 21418
I will back out the bad fix for 21418 so \\ will convert to \ in unicode. This should make srue the nsconv round trip conversion.
move to M16
Target Milestone: M14 → M16
*** Bug 28406 has been marked as a duplicate of this bug. ***
Keywords: beta2
reassign to bobj
Assignee: ftang → bobj
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Keywords: nsbeta2
Need more info on how critical this is to beta2.
Keywords: beta2
Summary: nsconv miconverts "\" in.properties files to "\\" → nsconv misconverts "\" in.properties files to "\\"
Whiteboard: [NEED INFO]
The prompting strings in the dialog UI will not be formatted/indented properly if this bug is not fixed.
I own 21418 now so I am taking this one over, too.
Assignee: bobj → tao
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Clearing [NEED INFO] to get on re-eval query for PDT.
Whiteboard: [NEED INFO]
Putting on [nsbeta2+] radar for beta2 fix.
Whiteboard: [nsbeta2+]
M16 has been out for a while now, these bugs target milestones need to be updated.
Hi, Frank: DO you have cycle on this? I'm swamped with PR2 tasks. THanks
Assignee: tao → ftang
Status: ASSIGNED → NEW
do we really need this for nsbeta2 ? Do we have work around ?
Status: NEW → ASSIGNED
This bug came from Yamamoto-san originally but since then they started using the Mozilla Translator tool. The problem still exists but I believe that Mozilla Translator tool can bypass this issue entirely. Kazu? Do you have an opinion on this?
I believe we can live without this for nsbeta2. Remove [nsbeta2+] and send mail to different parties.
Whiteboard: [nsbeta2+]
Now, I use the Mozilla Translator to localize messages. So I don't need to fix this bug soon.
Putting on [nsbeta2-] radar. Not critical to beta2.
Whiteboard: [nsbeta2-]
I have put fix for 26938 at http://warp/u/ftang/tmp/fix26938.txt . Notice, we have to check in http://warp/u/ftang/tmp/fix21418.txt before taking this fix. Otherwise, the property file will be break.
reverse the dependency. The fix 21418 block 26938
No longer blocks: 21418
Depends on: 21418
nsbeta3 and nsbeta3+
Keywords: nsbeta3
Whiteboard: [nsbeta2-] → [nsbeta2-][nsbeta3+]
fix and check in
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.