Luigi04
Luigi04

Reputation: 457

Question marks when using czech characters in python

I have the problem that some czech characters can not be displayed/printed properly in python. No matter which of the following version I use I always get a "?" when trying to print the character.

s1 = "č"
s2 = u"\u010D"
s3 = unicode(u'\u010D', "utf-8")
s4 = unicode('č', "utf-8")

What am I missing? I can print the characters ýýááíů but not ěščřřžž.

Thanks for the help.

Upvotes: 3

Views: 794

Answers (1)

MaxLunar
MaxLunar

Reputation: 663

Use combining caron with your chars instead of using solid char. Atleast this displays correctly in IDLE:

>>> test = '\u0065\u030c , \u0073\u030c , \u0063\u030c , \u0072\u030c , \u007a\u030c'
>>> print(test)
ě , š , č , ř , ž
>>> 

Upvotes: 1

Related Questions