+ 6
How is it possible to print the Hungarian vowels ĂĄ, Ă©, Ă, Ăł, ö, Ć, ĂŒ, Ʊ, plus the capital version of these, and Ă in Python?
I get totally different characters on my Android device for these accented vowels and for the German Ă in the output. What code do I need to add concretely in order to see the right accented vowel in the output? I'm also interested in Spanish, Portuguese and French characters like ñ, ç or ĂȘ. Thank you so much for your help!
5 Answers
+ 12
Try adding these lines at the beginning of your code:
import sys, codecs
sys.stdout = codecs.getwriter('utf-16')(sys.stdout.buffer, 'strict')
+ 4
Thank you so much, Anna! You saved me hours of googling. It works perfectly now! :)
+ 4
Freut mich zu hören đ
+ 4
import sys, codecs
sys.stdout = codecs.getwriter('utf-16')(sys.stdout.buffer, 'strict')
print("Vielen Dank nochmal, Anna!\nLiebe GrĂŒĂe aus Berlin! :)")
+ 3
Hola buenas.. alguien que ayude en pytnon.?