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

Summary: I18N wrong management of escape characters
Product: utilities Reporter: -Silver-
Component: PropertiesAssignee: Jan Peska <JPESKA>
Status: NEW ---    
Severity: normal    
Priority: P4    
Version: 7.3.1   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:

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