【发布时间】:2011-03-04 00:26:15
【问题描述】:
我有一个十六进制字符串,我想将其转换为 utf8 以插入 mysql。 (我的数据库是utf8)
hex_string = 'kitap ara\xfet\xfdrmas\xfd'
...
result = 'kitap araştırması'
我该怎么做?
【问题讨论】:
-
您是在源中定义 hex_string 还是来自外部源?
标签: python utf-8 hex python-2.x