• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new String(byte[])

 
Kejal Shah
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I pass a byte array to create a new String object. However, the byte representation of this new string is different from the one I pass it.

One of the bytes in the passed byte array is 0x90 or 144. However, in the string object tat i retrieve, this byte is 63!

Tx in adv
Kejal
[ February 23, 2005: Message edited by: Kejal Shah ]
 
Joe Ess
Bartender
Posts: 9302
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A String is supposed to represent characters, not the full range of the char data type. I would wager that the value you are attempting to set cannot be represented in your default charset so it gets substituted. For further info, read up on java.nio.charset.Charset and look up your local Unicode code chart
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic