I would like to call os.environ['UserProfile'] on my windows system. The value may be unicode, however the os.environ dict returns str types only, with non-ascii chars converted to question marks.
>>> os.environ['UserProfile']
'C:\\Users\\????'
How can I get the correct path of UserProfile under Windows?
- I'm using Python 2.7.3
- I'm working on Windows 7, but solution must work also on XP, Vista and 8.