开发者

Encoding issue while converting .txt file to .xml file

开发者 https://www.devze.com 2023-03-22 03:58 出处:网络
I have a .txt file which has more 10000 lines in it and my requirement is to convert each line into an xml file. The encoding of the xml file is iso-8859-1. Everything is getting converted properly ex

I have a .txt file which has more 10000 lines in it and my requirement is to convert each line into an xml file. The encoding of the xml file is iso-8859-1. Everything is getting converted properly except the "NO-BREAK SPACE" which resembles a spac开发者_如何学运维e but isnt an actual space. It is getting converted to some other symbol(A with a cap). With the xml writer and the stream writer i'm using the encoding iso-8859-1 only.

Kindly help me to resolve this issue.


If txt file has more characters than iso-8859-1, you can't do this without loosing information.

Either switch to Unicode or require txt file in iso-8859-1.

0

精彩评论

暂无评论...
验证码 换一张
取 消