Re: Trouble with the encoding of os.getcwd() in Korean Windows

From: Walter Dörwald (walter_at_livinglogic.de)
Date: 02/09/05


Date: Wed, 09 Feb 2005 18:11:02 +0100
To: Erik Bethke <erikbethke@gmail.com>

Erik Bethke wrote:
> Hello All,
>
> sorry for all the posts... I am *almost* there now...
>
> okay I have this code:
>
> import sys, os
>
> encoding = locale.getpreferredencoding()
> htmlpath = os.getcwd()
> htmlpath = htmlpath.decode( encoding )

You might want to try os.getcwdu() instead of this. According to
http://www.python.org/doc/2.4/lib/os-file-dir.html
this has been added in Python 2.3 and should work on Windows.

Bye,
    Walter Dörwald



Relevant Pages