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 41639

Summary: I18N - multibyte comment can not be saved correctly
Product: utilities Reporter: Keiichi Oono <keiichio>
Component: PropertiesAssignee: issues@utilities <issues>
Status: RESOLVED FIXED    
Severity: blocker CC: jf4jbug, pkeegan
Priority: P2 Keywords: I18N, REGRESSION, RELNOTE
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Keiichi Oono 2004-04-02 13:52:19 UTC
NetBeans 3.6 RC2
JDK 1.4.2
Solaris (ja)

to reproduce:
 - create properties file
 - add some key and messages in default language
 - Select  'Add locale' from properties file's 
   context menu
 - enter language code 'ja' (or other)
 - add translated value and comment with 
   mutlibyte character

I've checked file contents by selecting 'Edit'
from context menu. The value is saved correctly by
unicode escape, but the saved multibyte comments
are always '?' sign.
Comment 1 Marian Petras 2004-04-02 15:01:35 UTC
Confirmed.

The problem is that comments are not converted (native2ascii) during
saving. Reading is all right.
Comment 2 Marian Petras 2004-04-05 15:00:11 UTC
Fixed in the trunk.
Comment 3 Marian Petras 2004-04-05 15:03:29 UTC
The bug was fixed by modifying method

org.netbeans.modules.properties.Element.CommentElem.getDocumentString()

(it did not convert Java strings to ASCII strings using \uxxxx).
Comment 4 Marian Petras 2004-04-06 09:52:50 UTC
The bugfix will not be integrated in NetBeans 3.6 as it is too late
for such integration. The bugfix will be put into a hotfix update centre.
Comment 5 Patrick Keegan 2004-04-08 18:07:31 UTC
proposed relnote (please check carefully, since I can't see the bug):

Description: Comments with multibyte characters are not saved
correctly when use table editor for .properties files.

Workaround: Use the text editor to add any comments that contain
multibyte characters.
Comment 6 Marian Petras 2004-04-09 15:28:23 UTC
Re description:

   ... when use table editor ...
            ^^^

I am not a native English speaker but... is it the correct form?


As for the workaround:
Basically yes but you should know that it requires that the users need
to know unicode values of multibyte characters they want to enter. The
other effect is that the comments will be virtually unreadable.

For example a Czech equivalent of English word "heavy" would be
displayed as "t\u011b\u017ek\u00fd" which is not easy to read or
write. The situation is even worse for East Asian languages because
they use only multibyte characters.
Comment 7 Patrick Keegan 2004-04-09 15:39:21 UTC
Thanks for catching the typo and providing the supplementary info.
Take two:

Description: Comments with multibyte characters are not saved
correctly when you use the table editor for .properties files.

Workaround: Use the Edit command to open the text editor for the
.properties file. In the text editor, you must enter the multibyte
characters as Unicode values.