encoding - Java functions to encode Windows-1252 to UTF-8 getting the same symbol -
i new of forum. have problem conversion between encoding windows-1252 utf-8.
i have string encoded in windows-1252 (e.g. character: ¢). obtain same symbol, encoded in utf-8. mean: source character , destination character appear same (¢) different encoding.
is possibile? in addition: exists java function performs conversion automatically (e.g. passing starting encoding , end encoding)?
thank in advance of help.
hello, simone
you can transcode between various encodings using strings intermediary:
byte[] windows1252 = { (byte) 0xa2 }; string utf16 = new string(windows1252, charset.forname("windows-1252")); byte[] utf8 = utf16.getbytes(standardcharsets.utf_8);
char
data utf-16 in java.
Comments
Post a Comment