开发者

error font when get XML data non-unicode

I am trying post XML data (with encoding="euc-kr", non utf-8) from client to JSP server page.

XML data have format like below:

<?xml version="1.0" encoding="euc-kr" ?>
<book>
  <id>123456789</id>
  <name>한국어</name>
</book>

but on Server page, i can not get exactly font. Getting result return like below:

<name&g开发者_开发技巧t;Çѱ¹¾î</name>

font is error.

I am using JSP (client and server are jsp also). How i can get exactly front with non-unicode format?

Thank you!


Your data is fine. The client is interpreting it as CP1252 instead of EUC-KR.

>>> print u'Çѱ¹¾î'.encode('cp1252').decode('euc-kr')
한국어
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜