Windows XP - Environment variable - Unicode

sebastien.hugues sebastien.hugues at
Fri Jul 11 10:40:13 CEST 2003


I would like to retrieve the application data directory path of the 
logged user on
windows XP. To achieve this goal i use the environment variable

The logged user has this name: sébastien. The second character is not an
ascii one and when i try to encode the path that contains this name in 
i got this error:

Ascii error: index not in range (128)

I would like to first decode this string and then re-encode it in utf-8, but
i am not able to find out what encoding is used when i make:

appdata = os.environ ['APPDATA']

Any ideas ?

Thanks in advance

More information about the Python-list mailing list