Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340513 - [1.7][compiler] Unicode 6.0 characters work at compiler compliance level 1.5 and 1.6
Summary: [1.7][compiler] Unicode 6.0 characters work at compiler compliance level 1.5 ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-20 11:35 EDT by Deepak Azad CLA
Modified: 2011-08-05 02:54 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-03-20 11:35:41 EDT
BETA_JAVA7 branch
---------------------------------------------------------
package org.eclipse;

class Unicode_17 {
	public static void main(String[] args) {
		String \u20B9 = "Rupee symbol";    //1
		System.out.println(\u20B9);    

		String \u11009 = "Brahmi";       //2
		System.out.println(\u11009);
	}
}
--------------------------------------------------------
//1 (See http://www.unicode.org/charts/PDF/Unicode-6.0/U60-20A0.pdf)
//2 (See http://www.unicode.org/charts/PDF/Unicode-6.0/U60-11000.pdf)

- The above snippet works with BETA_JAVA7 branch and compiler compliance set to 1.5 or 1.6 (JRE used is 1.5 or 1.6). 
- The snippet gives a compiler error with 3.7M6 and compiler compliance set to 1.5 or 1.6 (again JRE used is 1.5 or 1.6). Even though both '1' and '2' are new Unicode 6.0 characters, there is a compile error only for '1', but no error for '2'.
Comment 1 Olivier Thomann CLA 2011-03-21 23:53:37 EDT
I tried with javac 1.7 b134 and it can compile this code fine.
I don't see how \u11009 is a valid unicode.
I am investigating.
Comment 2 Deepak Azad CLA 2011-03-21 23:59:10 EDT
(In reply to comment #1)
> I don't see how \u11009 is a valid unicode.

http://www.unicode.org/charts/PDF/Unicode-6.0/U60-11000.pdf says that 11009 is a valid Unicode 6.0 character.
Comment 3 Olivier Thomann CLA 2011-03-22 00:11:45 EDT
> http://www.unicode.org/charts/PDF/Unicode-6.0/U60-11000.pdf says that 11009 is
> a valid Unicode 6.0 character.
Yes, but this is not the way to represent it.
I think it should be replaced with high and low surrogates: \ud804\udc09.

If you write\u11009, this is seen as \u1100 followed by 9. I don't think this is what you meant.
Comment 4 Deepak Azad CLA 2011-03-22 00:24:33 EDT
(In reply to comment #3)
> > http://www.unicode.org/charts/PDF/Unicode-6.0/U60-11000.pdf says that 11009 is
> > a valid Unicode 6.0 character.
> Yes, but this is not the way to represent it.
> I think it should be replaced with high and low surrogates: \ud804\udc09.
Sorry, you are right :)
Comment 5 Olivier Thomann CLA 2011-03-22 20:59:45 EDT
Released in BETA_JAVA7 branch
Comment 6 Jay Arthanareeswaran CLA 2011-06-29 08:32:00 EDT
Verified.