Trouble with the encoding of os.getcwd() in Korean Windows
From: Erik Bethke (erikbethke_at_gmail.com)
Date: 02/09/05
- Next message: sandy: "Performance Issues of MySQL with Python"
- Previous message: Carlos Ribeiro: "Re: empty classes as c structs?"
- Next in thread: Erik Bethke: "Re: Trouble with the encoding of os.getcwd() in Korean Windows"
- Reply: Erik Bethke: "Re: Trouble with the encoding of os.getcwd() in Korean Windows"
- Reply: Vincent Wehren: "Re: Trouble with the encoding of os.getcwd() in Korean Windows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Feb 2005 04:56:04 -0800
Hello All,
I have found much help in the google archives but I am still stuck...
here is my code snippet:
path = os.getcwd()
path = path.decode('UTF8')
Now the trouble is I am getting that darn UnicodeDecodeError, where it
is tripping up on the Korean hangul for My Desktop. Now I have tried
utf8 and utf16 and neither of these works.
So is this my question?: What encoding does windows use for Korean
Windows? I thought it might be and so I surfed around
(http://foundationstone.com.au/HtmlSupport/OnlineHelp/Localisation/SupportedEncodings.html)
and there appears to be an encoding called: windows-949 labeled to be
Korean Windows, which of couse is *not* one of the encodings to be
found in the encodings package... which would suck.
But then I thought about it some more, how could you make software to
do things like read the current directory work on different language
machines??? It would be madness to have a try statement for each and
every encoding under the sun...
Why isn't there a get system encoding method?
Or am I on the entirely wrong track?
Thanks,
-Erik
- Next message: sandy: "Performance Issues of MySQL with Python"
- Previous message: Carlos Ribeiro: "Re: empty classes as c structs?"
- Next in thread: Erik Bethke: "Re: Trouble with the encoding of os.getcwd() in Korean Windows"
- Reply: Erik Bethke: "Re: Trouble with the encoding of os.getcwd() in Korean Windows"
- Reply: Vincent Wehren: "Re: Trouble with the encoding of os.getcwd() in Korean Windows"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|