0

Accents about python

When I print my code that contain word with accent ("Ă©" for example) in python, it changes completly (something like "ñ€Á") Why ?? And how to fix this ??

23rd Sep 2020, 8:17 PM
Usmaan NgOm
Usmaan NgOm - avatar
4 Answers
+ 3
Add this line to the begining of your code # -*- coding: utf-8 -*-
23rd Sep 2020, 8:30 PM
HBhZ_C
HBhZ_C - avatar
+ 2
Try to add u at the begin of string s = u"Ă©ĂčĂ”..."
23rd Sep 2020, 9:49 PM
HBhZ_C
HBhZ_C - avatar
+ 1
Usmaan NgOm python can works with Utf8. So if you use not ansi char, you need remember about type hint: https://code.sololearn.com/cd16R8Iowspb/?ref=app
23rd Sep 2020, 10:34 PM
Petr
0
HBhZ_C it doesn't work 😔😔
23rd Sep 2020, 9:34 PM
Usmaan NgOm
Usmaan NgOm - avatar