win-1251 > utf-8

Hi, I need to convert xml file content from win-1251 to utf-8.How I may do it? What Java apis I need to use?
[129 byte] By [dbes@isd.dp.uaa] at [2007-11-26 22:13:49]
# 1

I think another qustion about converting to a different encoding was answered in the forum recently; you may try to search for that.

I believe you can use new InputStreamReader(FileInputStream, "WIN-1251") and then String.getBytes("UTF-8") on a String read from input, and then write the bytes to output. The encoding name may not be "WIN-1251". While this may not be enough to solve your problem, I hope it points in the right direction.

OleVVa at 2007-7-10 11:04:24 > top of Java-index,Java Essentials,Java Programming...
# 2
You don't need String.getBytes, you just need to write it in an outputstream that has the proper encoding, such as new OutputStreamWriter(myFileOutputStream, "UTF-8")
-Kayaman-a at 2007-7-10 11:04:24 > top of Java-index,Java Essentials,Java Programming...
# 3
... and replace the encoding note in the XML header. Alternatively parse XML to a DOM document and write it out again using a Transformer set to UTF-8 encoding.
quittea at 2007-7-10 11:04:24 > top of Java-index,Java Essentials,Java Programming...