Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with '\udc00'  RSS feed

 
Ilaria Ballamuti
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
the following piece of code gives me unespected results
char[] c = {'\udc00'};
charArray = new String(c);
System.out.println(charArray.length());
System.out.println(charArray.getBytes().length);
The first print gives me 1, the second 0.
Could you please explain me the reason ?
Thanx in advance
Ilaria
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!