This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 14033 - I18N - localized comments in resource bundle do not use unicode escape sequence
Summary: I18N - localized comments in resource bundle do not use unicode escape sequence
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Properties (show other bugs)
Version: -FFJ-
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@utilities
URL: http://java.sun.com/j2se/1.3/docs/api...
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2001-07-30 08:16 UTC by Kazuma Yasaka
Modified: 2003-07-01 14:21 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screen shot (9.13 KB, image/png)
2001-07-30 08:18 UTC, Kazuma Yasaka
Details
screen shot (9.61 KB, image/png)
2001-07-30 08:19 UTC, Kazuma Yasaka
Details
The English local resource (It's for reference, I tested with ja). (205 bytes, text/plain)
2002-01-17 12:46 UTC, Keiichi Oono
Details
convert without WS patch (7.24 KB, application/octet-stream)
2002-01-17 14:15 UTC, Martin Roskanin
Details
fix one: converting comment to unicode sequence (1.46 KB, text/plain)
2002-01-18 09:55 UTC, Martin Roskanin
Details
fix two: do not convert whitespaces to unicode sequences (3.88 KB, text/plain)
2002-01-18 09:56 UTC, Martin Roskanin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kazuma Yasaka 2001-07-30 08:16:33 UTC
OS:RedHat 6.2J, SDK:Sun Java SDK 1.3.1 for Linux, Locale:ja_JP.ujis

To reproduce

1)Making resource bundle uzing i18n wizard
2)Add locale to resource bundle
3)Edit the resource bundle from source editor, use open of context
menu(editor00.png)
4)View the resource bundle using source editor, use edit of context
menu(editor01.png)

Details

We can edit the resource in souce editor for each locale. Also we can add
comments for each locale. The comments should be saved using Unicode escape
sequence, but source editor uses native encoded string. Properties for bundle
and I18n wizard both use Unicode escape sequence.
Comment 1 Kazuma Yasaka 2001-07-30 08:18:55 UTC
Created attachment 2007 [details]
Screen shot
Comment 2 Kazuma Yasaka 2001-07-30 08:19:50 UTC
Created attachment 2008 [details]
screen shot
Comment 3 _ pkuzel 2001-11-21 10:06:15 UTC
Yes, the ISO 8859-1 character encoding must be used, using "\u"
escaping for other characters. It is responsibility of properties
module.
Comment 4 _ pkuzel 2001-11-21 10:07:18 UTC
Contacts updated.
Comment 5 Jan Chalupa 2001-11-27 16:55:02 UTC
Target milestone -> 3.3.1.
Comment 6 Keiichi Oono 2002-01-16 14:05:32 UTC
We don't have any workaround except not to use this editor. But this
editor is really help to create resource bundles. And besides, this
problem corrupts the user input characters. Could you make progress?
Comment 7 Martin Roskanin 2002-01-16 17:00:40 UTC
fixed in [maintrunk]

/cvs/properties/src/org/netbeans/modules/properties/PropertiesTableCel
lEditor.java,v  <--  PropertiesTableCellEditor.java
new revision: 1.22; previous revision: 1.21

Please verify the fix in tomorrow (17.01.2002) build 

or 

using the attached patch by
installing the local.jar into 
<NBDir>/modules/patches/org-netbeans-modules-properties/ folder

If the fix will be correct and verified I will try to integrate it 
into the release NB 3.3.1. 

Thank you!

Mato
Comment 8 Keiichi Oono 2002-01-17 12:45:00 UTC
Thank you Meto!
It's really quick. I've verified on Build 200201170100. The multibyte
comments works fine! This problem has been fixed.
However, I have a questions. The saved file is encoded to unicode
escape. And the LF (0x000a) in comments is also converted to "\u000a".
. It's only in comment. See attached properties file for detail.
I think it's better not to convert LF, because the number of lines is
different between default resource file and local resource file. What
do you think about it?

Again, thank you.
Keiichi
Comment 9 Keiichi Oono 2002-01-17 12:46:36 UTC
Created attachment 4237 [details]
The English local resource (It's for reference, I tested with ja).
Comment 10 Martin Roskanin 2002-01-17 14:02:59 UTC
fixed in [maintrunk]

/cvs/properties/src/org/netbeans/modules/properties/PropertiesTableCel
lEditor.java,v  <--  PropertiesTableCellEditor.java
new revision: 1.23; previous revision: 1.22

/cvs/properties/src/org/netbeans/modules/properties/UtilConvert.java,v 
 <--  UtilConvert.java
new revision: 1.8; previous revision: 1.7

Hello Keiichi,

thank you for your testing. 
I have fix the bug with converting the whitespaces. Please, verify the 
fix. I am attaching the patch.

Mato
Comment 11 Martin Roskanin 2002-01-17 14:15:47 UTC
Created attachment 4244 [details]
convert without WS patch
Comment 12 Martin Roskanin 2002-01-17 14:20:01 UTC
Keiichi,
Please, copy the attached patch local2.jar into 

<NBDir>/modules/patches/org-netbeans-modules-properties/ folder

and restart NB.
Thank you,
Mato
Comment 13 Keiichi Oono 2002-01-18 08:54:52 UTC
Hello Meto,
I've verified the fixing in Build 200201170100 and your patch
(local2.jar). Everything works fine!

Thank you.
Keiichi
Comment 14 Martin Roskanin 2002-01-18 09:52:42 UTC
The fix is easy. 
Comment had to be convert to unicode. It was done using 
UtilConvert.charsToUnicodes(...) method as shown in the attachement 
diff1.txt

Because UtilConvert.charsToUnicodes(...) converts to unicode also 
whitespaces, it was needed to make additional fix of the bug. The 
method UtilConvert.charsToUnicodes(String s) has been overloaded by
charsToUnicodes(String theString, boolean escapeWhiteSpaces)

where parameter escapeWhiteSpaces allows to specify whether convert WS 
or not.

The fix is shown in the diff2.txt

The fix has been verified on the japan localized machine.

How to test:
-----------

open properties file to table editor, add some comment to existed 
pair. Modification is done also in source editor of the properties 
file. The comment in source editor have to be saved using Unicode 
escape sequence.

Please, use attached patch local2.jar for testing.

I would like to ask for approval for integrating this fix into 
NB 3.3.1.

Thank you.
Comment 15 Martin Roskanin 2002-01-18 09:55:23 UTC
Created attachment 4261 [details]
fix one: converting comment to unicode sequence
Comment 16 Martin Roskanin 2002-01-18 09:56:27 UTC
Created attachment 4262 [details]
fix two: do not convert whitespaces to unicode sequences
Comment 17 eadams 2002-01-18 10:17:40 UTC
Approved.
Comment 18 brinkley 2002-01-18 10:44:34 UTC
approved
Comment 19 Jan Chalupa 2002-01-18 11:00:12 UTC
Approved by QA.
Comment 20 Martin Roskanin 2002-01-18 14:10:17 UTC
Integrated in [release33] branch.

/cvs/properties/src/org/netbeans/modules/properties/PropertiesTableCel
lEditor.java,v  <--  PropertiesTableCellEditor.java
new revision: 1.21.6.1; previous revision: 1.21

/cvs/properties/src/org/netbeans/modules/properties/UtilConvert.java,v 
 <--  UtilConvert.java
new revision: 1.7.42.1; previous revision: 1.7
Comment 21 Martin Roskanin 2002-01-18 14:11:36 UTC
changed target milestone
Comment 22 Keiichi Oono 2002-01-22 12:42:46 UTC
Verified in IDE 3.3.1 RC2
(NetBeansIDE-release331-200201210331.zip)
Comment 23 Jesse Glick 2002-12-23 16:37:49 UTC
Consistent use of the I18N keyword.
Comment 24 Quality Engineering 2003-07-01 14:21:15 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.