什麼是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