Re: Can I get the 8bit-string representation of any unicode string

2006-02-12 Thread wanghz
Hi, I see. Thank you for your help! Regards, hongzheng Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote > > > I may misunderstood it. I will think about it carefully. > > > > By the way, does python has a interface, just like iconv in libc for > > C/C++? Or, how can I convert a string from a e

Re: Can I get the 8bit-string representation of any unicode string

2006-02-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote > I may misunderstood it. I will think about it carefully. > > By the way, does python has a interface, just like iconv in libc for > C/C++? Or, how can I convert a string from a encoding into another > one? if b is an 8-bit string containing an encoded unicode string,

Re: Can I get the 8bit-string representation of any unicode string

2006-02-12 Thread wanghz
Thank you all for your replies :-) I may misunderstood it. I will think about it carefully. By the way, does python has a interface, just like iconv in libc for C/C++? Or, how can I convert a string from a encoding into another one? Thank you so much. -- http://mail.python.org/mailman/listi

Re: Can I get the 8bit-string representation of any unicode string

2006-02-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I have a problem when I'm processing unicode strings. Is it possible > to get the 8bit-string representation of any unicode string? > > Suppose I get a unicode string: > a = u'\xc8\xce\xcf\xcd\xc6\xeb'; > then, by > a.encode('latin-1'); > I can get the 8bit-string r

Re: Can I get the 8bit-string representation of any unicode string

2006-02-12 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hello, everyone. > > I have a problem when I'm processing unicode strings. Is it possible > to get the 8bit-string representation of any unicode string? Yes, if you can be more precise about what you mean by '8bit-string representation'. Likely candidates are b.encode