[Python-Dev] Unicode and Windows

M.-A. Lemburg mal@lemburg.com
Tue, 21 Mar 2000 13:14:54 +0100


Jack Jansen wrote:
> 
> I guess we need another format specifier than "s" here. "s" does the
> conversion to standard-python-utf8 for wide strings,

Actually, "t" does the UTF-8 conversion... "s" will give you
the raw internal UTF-16 representation in platform byte order.

> and we'd need another
> format for conversion to current-local-os-convention-8-bit-encoding-of-unicode-
> strings.

I'd suggest adding some king of generic

	PyOS_FilenameFromObject(PyObject *v,
				void *buffer,
				int buffer_len)

API for the conversion of strings, Unicode and text buffers
to an OS dependent filename buffer.

And/or perhaps sepcific APIs for each OS... e.g.

	PyOS_MBCSFromObject() (only on WinXX)
	PyOS_AppleFromObject() (only on Mac ;)

> I assume that that would also come in handy for MacOS, where we'll have the
> same problem (filenames are in Apple's proprietary 8bit encoding).

Is that encoding already supported by the encodings package ?
If not, could you point me to a map file for the encoding ?

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/