Windows XP - Environment variable - Unicode

sebastien.hugues sebastien.hugues at swissinfo.org
Fri Jul 11 04:40:13 EDT 2003


Hi

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
APPDATA.

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 
utf-8,
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
Sebastien





More information about the Python-list mailing list