【发布时间】:2017-05-13 12:42:24
【问题描述】:
我想将梵文脚本字符(例如“अ”)转换为其 unicode 表示形式 \u0905。
在 python2.7 的早期,我使用each_character.encode("unicode_escape"),其中each_character 指的是梵文脚本字符。
但是最近我开始研究python3,当我运行上面的sn-p时出现以下错误?
expected str instance, bytes found
任何人都可以提出一种将所有字符转换为其 unicode 表示的方法。我正在研究一个梵文 OCR,我需要 Unicode 表示以便将它们作为基本事实传递。
【问题讨论】:
-
请发布一个示例脚本来演示该问题。应该只有几行。
标签: python python-3.x unicode python-3.5