Python Utf8 Convert To Gbk
Join the DZone community and get the full member experience.
Join For Free// description of your code here
def utf2gbk(s,ignore=True):
if ignore:
return unicode(s,'utf8','ingore').encode('gb18030','ingore')
else:
return unicode(s,'utf8').encode('gb18030')
Python (language)
Convert (command)
Opinions expressed by DZone contributors are their own.
Comments