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 232463 - I18N wrong management of escape characters
Summary: I18N wrong management of escape characters
Status: NEW
Alias: None
Product: utilities
Classification: Unclassified
Component: Properties (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7 x64
: P4 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-09 16:46 UTC by -Silver-
Modified: 2013-07-09 16:46 UTC (History)
0 users

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 -Silver- 2013-07-09 16:46:44 UTC
BUG REPRODUCTION

Suppose to have this simple java application:

public static void main(String[] args) {
    System.out.println("This is a string with \"escape\" characters \n");
}

If it runs the output is correctly:
This is a string with "escape" characters 


Now if I go to Tools -> Internationalization -> Internationalization Wizard.
In the wizard I click always next with all the default parameters (just I create a new resource bundle when it is required).

The resulting application became as follows:

public static void main(String[] args) {
    System.out.println(java.util.ResourceBundle.getBundle("test/bundle").getString("THIS IS A STRING WITH \"ESCAPE\" CHARACTERS \N"));
}


PROBLEMS:
1) The key generated by default contains also the escape character, this is a problem for example with the character \n that to upper case became \N that is not a valid escape character. (I suggest to avoid to put escape characters in the keys).
2) The value string generated in the bundle.properties contains the escape of the escape character (so \ becames \\) so the output of the application became 

This is a string with \"escape\" characters \n