Java encode string to UCS -


i need encode utf-8 string ucs 'q' '\u0071' or '龥' '\u9fa5' in java. have tried code wrong result ...

new string(inputstring.getbytes("iso8859_1"), "utf-8");

if don't mind apache commons, try:

org.apache.commons.lang.stringescapeutils#escapejavastylestring


Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

tags - Jquery Mixitup plugin help prevent handlers being destroyed -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -