开发者

error font when get XML data non-unicode

开发者 https://www.devze.com 2023-02-01 22:58 出处:网络
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:

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

精彩评论

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