简体   繁体   English

无法在pydev eclipse控制台中显示unicode字符

[英]unable to display unicode characters in pydev eclipse console

I am trying to manipulate some UTF-8 text in pydev eclipse but it doesn't print them properly: 我正在尝试在pydev eclipse中处理一些UTF-8文本,但无法正确打印它们:

eg 例如

 ['217080104288', 'Post from \xd8\xa3\xd8\xb2\xd8\xb1\xd9\x8a        \xd8\xba\xd9\x84\xd8\xaa\xd9\x88\xd9\x85  ', '\xd8\xa3\xd8\xb2\xd8\xb1\xd9\x8a \xd8\xba\xd9\x84\xd8\xaa\xd9\x88\xd9\x85', 'Project Sunlight by Unilever Setelah video pendek ini selesai, anda akan diarahkan untuk menjawab survei dan menghasilkan Rp. 5000 Video mungkin tidak dapat diputar di semua browser. Kami sarankan untuk menggunakan Chrome.'

in notepad++ it displays correctly: 在记事本++中,它可以正确显示:

217080104292,"Post from أزري غلتوم  ","أزري غلتوم","Project Sunlight by Unilever Setelah video pendek ini selesai, anda akan diarahkan untuk menjawab survei dan menghasilkan Rp. 5000 Video mungkin tidak dapat diputar di semua browser. Kami sarankan untuk menggunakan Chrome.","facebook.com Discussions","Feb 09, 2014 04:18 AM",0,0,0,0,0,0,0,0,0,0,Neutral

even encode("UTF-8") doesn't display it properly. 甚至encode(“ UTF-8”)也无法正确显示。

When you print a list , it uses repr on every element of the list to turn it into a string. 当您打印list ,它在列表的每个元素上使用repr将其转换为字符串。 repr is designed to be extra conservative, it displays Unicode characters that aren't ASCII as escape sequences always. repr的设计非常保守,它始终将非ASCII的Unicode字符显示为转义序列。 If you want to print the string naturally, print it individually instead of trying to print the list that encloses it. 如果要自然打印字符串,请单独打印它,而不要尝试打印包含它的list

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM