什么是Perl的Encode::_utf8_off
的等效函数?perl Encode :: _ utf8_off in python
回答
你应该从来没有有史以来使用Encode::_utf8_off
。
您可能正尝试使用UTF-8编码字符串。在Perl中,你可以使用任何如下:
utf8::encode($s);
utf8::encode(my $utf8 = $uni);
use Encode qw(encode_utf8); my $utf8 = encode_utf8($uni);
use Encode qw(encode); my $utf8 = encode('UTF-8', $uni);
我不知道Python,但快速搜索发现
utf8 = uni.encode('UTF-8', 'strict')
我的问题类似于:http://stackoverflow.com/questions/12994100/perl-encode-pm-cannot-decode-string-with-wide-character Encode :: _ utf8_off解决了我的问题。但我的脚本的一部分是在python和python脚本有相同的问题。所以我在Python中寻找相同的函数,以便我可以在那里应用。 –
我重复一遍:永远不要使用'Encode :: _ utf8_off'。孟露正在传递一些没有编码的东西来“解码”。孟露问题的解决方案不是添加'_utf8_off'。解决方案是修复他们的错误代码。 – ikegami
嘿..谢谢,我会尝试utf :: downgrade。但只是想知道,你能解释为什么我永远不要使用Encode :: _ utf8_off? –
- 1. encode Netbios name python
- 2. wp.uploadFile xmlrpc python encode base64
- 3. Decode Hash :: MultiValue in perl
- 4. ls -ltr in perl
- 5. Muetexes in perl&MySQL
- 6. 使用$/in perl
- 7. 在Python中使用unicode()和encode()函数
- 8. Perl:utf8 :: decode与Encode :: decode
- 9. sed in perl脚本
- 10. hmac sha-256 in perl
- 11. Python 2.6:encode()不带关键字参数
- 12. Vector3 in Meep in Python
- 13. Zend :: encode + blob
- 14. Encode Emoji图标
- 15. Datatables encode HTML
- 16. Swift encode WhatsApp URL
- 17. C#mvc2 encode url
- 18. PHP 4.4.1 JSON ENCODE
- 19. FFmpeg remux without decode/encode
- 20. Memory Efficient Hot Encode Pandas
- 21. encode]]>在cdata中
- 22. AttributeError:'NoneType'对象在python 2.7中没有属性'encode'
- 23. Python | Pyodbc |使用.Encode('utf-8')将FetchAll()编码为Utf-8
- 24. __rlshift__,__ror__ in Python
- 25. Quicksort in place Python
- 26. strncmp in python
- 27. Python“in”魔法?
- 28. Var in python 2.7
- 29. Bytearray sum in python
- 30. GIS:line_locate_point()in Python
不要以另一种语言给出函数的名称,请说出你想要做的事情。 – ikegami