• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unicode character swallowing characters after it

 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I�ve got the following code snippet:
------------------------------------



And I expect the output to be:
------------------------------

A sample unicode character [�]
File Encoding [UTF-8]

But I get:
----------

A sample unicode character [�ile Encoding [UTF-8]

Does anyone know what I�m doing wrong? The unicode character appears to swallow the �]� and newline character after it.

This is running on Linux with en_GB-UTF-8 locale and JDK1.5.0_15
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind, I suspect this is being caused because the en_GB UTF-8 encoding can't actually translate the u\3050 character (which is Japanese).

If I use the following code (running inside Eclipse which is UTF-8 but locale agnostic) then I get the expected Japanese character.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!