On Fri, Feb 6, 2009 at 1:49 AM, Kalyankumar Ramaseshan <soft_sm...@yahoo.com> wrote: > > Hi, > > Excuse me if this is a repeat question! > > I just wanted to know how are strings represented in python? > > I need to know in terms of: > > a) Strings are stored as UTF-16 (LE/BE) or UTF-32 characters?
IIRC, Depends on what the build settings were when CPython was compiled. UTF-16 is the default. > b) They are converted to utf-8 format when it is needed for e.g. when storing > the string to disk or sending it through a socket (tcp/ip)? No. They are implicitly converted to ASCII in such cases. To properly handle non-ASCII Unicode characters, you need to encode/decode the strings to/from bytes manually by specifying the encoding. Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list