Diez B. Roggisch wrote:
Maxim Kasimov wrote:


there are a few questions i can find answer in manual:
1. how to define which is internal encoding of python unicode strings
(UTF-8, UTF-16 ...)


It shouldn't be your concern - but you can specify it using " ./configure
--enable-unicode=ucs2" or --enable-unicode=ucs4. You can't set it to utf-8
or utf-16.
is that means that python internal unicode format is ucs2 or ucs4?
i'm concerning with the qustion because i need to send data to external
application in ucs2 encoding


2. how to convert string to UCS-2


s = ... # some ucs-2 string
s.decode("utf-16")
not _from_ ucs2, but _to_ ucs2, for example:
s = ... # some utf-16 string
d = encode_to_ucs2(s)


might give you the right results for most cases:

http://mail.python.org/pipermail/python-dev/2002-May/024193.html




--
Best regards,
Maxim
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to