Re: [Tutor] sys.getfilesystemencoding()

2012-12-20 Thread eryksun
On Thu, Dec 20, 2012 at 1:01 PM, Albert-Jan Roskam wrote: > >> You shouldn't encode a string argument you've declared as c_wchar_p >> (i.e. wintypes.LPCWSTR, i.e. type 'Z'). > > Ok, yes, that was plain stupid of me. On Windows, CPython 3.3 presents a twist. sizeof(c_wchar) is 2, but sys.maxunicod

Re: [Tutor] sys.getfilesystemencoding()

2012-12-20 Thread Albert-Jan Roskam
> On Wed, Dec 19, 2012 at 5:43 AM, Albert-Jan Roskam > wrote: >> >> So MBCS is just a collective noun for whatever happens to be the >> installed/available codepage of the host computer (at least with >> CP_ACP)? > > To be clear, the "mbcs" encoding in Python uses CP_ACP. MBCS means > multibyt

Re: [Tutor] sys.getfilesystemencoding()

2012-12-19 Thread eryksun
On Wed, Dec 19, 2012 at 5:43 AM, Albert-Jan Roskam wrote: > >So MBCS is just a collective noun for whatever happens to be the >installed/available codepage of the host computer (at least with >CP_ACP)? To be clear, the "mbcs" encoding in Python uses CP_ACP. MBCS means multibyte character set. The

Re: [Tutor] sys.getfilesystemencoding()

2012-12-19 Thread Albert-Jan Roskam
> > From: eryksun >To: Albert-Jan Roskam >Cc: Python Mailing List >Sent: Tuesday, December 18, 2012 4:07 PM >Subject: Re: [Tutor] sys.getfilesystemencoding() > >On Tue, Dec 18, 2012 at 8:13 AM, Albert-Jan Roskam wrote: >> >&

Re: [Tutor] sys.getfilesystemencoding()

2012-12-18 Thread eryksun
On Tue, Dec 18, 2012 at 8:13 AM, Albert-Jan Roskam wrote: > >In windows xp, the characters can, apparently, not be represented >in this encoding called 'mbcs'. MBCS (multibyte character set) refers to the locale encoding on Windows. CPython encodes to MBCS via the Win32 function WideCharToMultiBy

Re: [Tutor] sys.getfilesystemencoding()

2012-12-18 Thread Albert-Jan Roskam
- Original Message - > From: eryksun > To: Albert-Jan Roskam > Cc: Python Mailing List > Sent: Tuesday, December 18, 2012 2:52 PM > Subject: Re: [Tutor] sys.getfilesystemencoding() > > On Tue, Dec 18, 2012 at 8:13 AM, Albert-Jan Roskam > wrote: >> >

Re: [Tutor] sys.getfilesystemencoding()

2012-12-18 Thread Oscar Benjamin
On 18 December 2012 13:13, Albert-Jan Roskam wrote: > I am trying to write a file with a 'foreign' unicode name (I am aware that > this is a highly western-o-centric way of putting it). In Linux, I can encode > it to utf-8 and the file name is displayed correctly. In windows xp, the > character

Re: [Tutor] sys.getfilesystemencoding()

2012-12-18 Thread eryksun
On Tue, Dec 18, 2012 at 8:13 AM, Albert-Jan Roskam wrote: > > # Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) > [MSC v.1500 32 bit (Intel)] on win32 > > import sys > > def _encodeFileName(fn): > """Helper function to encode unicode file names into system file names. > http://effbot.or

Re: [Tutor] sys.getfilesystemencoding()

2012-12-18 Thread Peter Otten
Albert-Jan Roskam wrote: > I am trying to write a file with a 'foreign' unicode name (I am aware that > this is a highly western-o-centric way of putting it). In Linux, I can > encode it to utf-8 and the file name is displayed correctly. In windows > xp, the characters can, apparently, not be repr