anil maran wrote:
> In [1]: s='\x92'
>
> In [3]: s.decode('latin-1').encode('utf-8')
>
>
> Out[3]: '\xc2\x92'
>
> is this some kind of python shell, pls clarify
Yes, it's IPython.
http://ipython.scipy.org/

Kent
>
> */Kent Johnson <[EMAIL PROTECTED]>/* wrote:
>
>     anil maran wrote:
>     > Unicode?
>     > im getting this error:
>     > invalid byte sequence for encoding "UTF8": 0x92
>     >
>     > since the db is not handling latin-1 and is set to use UTF8 how
>     do i
>     > handle this
>
>     If you have a latin-1 string and you want utf-8, convert it to
>     Unicode
>     and then to utf-8 using decode() and encode():
>
>     In [1]: s='\x92'
>
>     In [3]: s.decode('latin-1').encode('utf-8')
>     Out[3]: '\xc2\x92'
>
>     Kent
>
>     _______________________________________________
>     Tutor maillist - [email protected]
>     http://mail.python.org/mailman/listinfo/tutor
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>


_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to