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 98930 - I18N - Form editor inserts escaped unicode characters.
Summary: I18N - Form editor inserts escaped unicode characters.
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@guibuilder
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2007-03-26 10:24 UTC by Tomas Zezula
Modified: 2008-07-29 15:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2007-03-26 10:24:30 UTC
Form editor inserts escaped unicode characters even when the project can handle
these characters.
Comment 1 Tomas Pavek 2007-06-11 16:14:15 UTC
Could you please remind me what was exactly the problem here? Generated string
property values?
Comment 2 Tomas Zezula 2007-06-11 16:38:51 UTC
The problem was that the form escapes the Chinese characters even when it's not
needed, the files is in Chinese encoding. I don't know how much it's important,
the code is generated, but it may be a problem for generated fields which may be
used by developer. For example private "JButton \u323\u3434\u3434;".
Comment 3 Tomas Pavek 2007-07-17 10:31:22 UTC
Only the string literals were escaped to unicode, I've removed that.

/cvs/form/src/org/netbeans/modules/form/editors/StringArrayEditor.java
new revision: 1.7; previous revision: 1.6
/cvs/form/src/org/netbeans/modules/form/editors/StringEditor.java
new revision: 1.3; previous revision: 1.2
Comment 4 Tomas Pavek 2007-07-17 10:31:56 UTC
Fixed.
Comment 5 Ken Frank 2007-09-29 03:22:21 UTC
am verifying - let me know if this is ok  ?
in the java code,
the name of the button, its variable name, its label, all have multibyte and all the mbyte
in the java code shows as mbyte, not as escapped chars.

ken.frank@sun.com
Comment 6 gtlang 2008-07-29 05:57:39 UTC
The characters in java files are ok now, but in .form files, the characters are still escaped, for example

<Property name="text" type="java.lang.String" value="&#x6587;&#x4ef6;&#x5217;&#x8868;"/>

The .form files are all UTF-8 encoded xml files, why should multibyte characters been escaped?
Sometimes I simply want to change the text of a label using a text editor, there are no need to launch NetBeans. 
Now, search and replace multibyte characters in java files are easy, but it is difficult in .form files.
Comment 7 Tomas Pavek 2008-07-29 15:18:53 UTC
I'm not sure exactly why .form is marked as UTF-8, but in fact it has always been in ascii. We could use UTF-8 for 
multibyte chars, but does not seem that important:
1) Form file is not intended to be edited directly by users, it is an internal file you should never see in NetBeans. 
Readability is not a hard requirement (it is correctness and reliability).
2) Search/replace currently does not work for form files in the IDE anyway: issue 111202.
3) For the case you describe it is better to internationalize the text - then change them in properties files. 
Automatic internationalization is now very easy to use for GUI forms.

If you think this is still important for you, please file a separate enhancement request. This issue report is about 
something else (multibyte chars used for identifiers in java code). Changing back to fixed.
Comment 8 Tomas Pavek 2008-07-29 15:27:57 UTC
Þ
Comment 9 Ken Frank 2008-07-29 15:32:49 UTC
gtlang, since issue 111202 exists for the search/replace, is this issue
itself resolved ok for you ? also, please comment in 111202 about that
situation.

ken.frank@sun.com