Correctly displaying a unicode string from a variable in Python -
i have python script reads text excel file , assigns string variable.
one of these strings follows:
"merhaba öncelikle size iyi çal\u0131\u015fmalar dilerim.ba\u015f\u0131mdan geçen bir"
i've been able display correctly when doing this:
print u"merhaba öncelikle size iyi çal\u0131\u015fmalar dilerim.ba\u015f\u0131mdan geçen bir"
when run in script this:
merhaba öncelikle size iyi çalışmalar dilerim.başımdan geçen bir
but can not figure out how convert/display correctly string when receiving them output excel file.
i've tried this:
mystring = "merhaba öncelikle size iyi çal\u0131\u015fmalar dilerim.ba\u015f\u0131mdan geçen bir" print mystring.decode("unicode_escape")
but prints out:
merhaba öncelikle size iyi çalışmalar dilerim.başımdan geçen bir
Comments
Post a Comment