Bonjour,
Dans un encodage interne, le caractère @ = '00'.
En unicode @ = '\u0040'.
A partir de l'information '00', je souhaite récupérer '@' dans une variable type string sachant que j'utilise Python 3.x
Avec Python 2.x, j'utilisais la methode suivante:
Merci par avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 internal2unicode_dict = { '00':'0040', '01':'00A3', '02':'0024', '03':'00A5', '04':'00E8'} internal = '00' if internal in internal2unicode_dict: str = u'\u" + internal2unicode_dict[internal] + "'"
Partager