This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Unicode character swallowing characters after it

 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • 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
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • 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.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic