Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTF-16 string problem

807589Jul 1 2008 — edited Jul 1 2008
Hi All,

I am developing an application which read from a file which contain data in UTF-16 encoding, when i get string from file and verify it with an external application i got following error

"UTF-16 strings must have an even number of bytes"

After that i read all bytes from string i found that it contain \u00 char due to which it showing this error, do any one can tell me why this is coming is it null char. i open file in Notepad it showing me some non printable character

\u0038\u0032\u0032\u0030\u0033\u0038\u0035\u0031\u0036\u0032\u0030\u0032\u0033\u0020\u00

Please help how i can manage this \u00 and how we can trim unicode string because normal string function dont trim correctly

Regards,
imran
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2008
Added on Jul 1 2008
5 comments
1,046 views