java - Convert escaped Unicode character back to actual character -
i have following value in string variable in java has utf-8 characters encoded below
dodd\u2013frank
instead of
dodd–frank
(assume don't have control on how value assigned string variable)
now how convert (encode) , store in string
variable?
i found following code
charset.forname("utf-8").encode(str);
but returns bytebuffer
, want string
back.
edit:
some more additional information.
when use system.out.println(str);
dodd\u2013frank
i not sure correct terminology (utf-8 or unicode). pardon me that.
Comments
Post a Comment