FAQ
Dear All:
I got a coding problem when I use python to read html from web which is encode with gb2312,
ater I insert the data I read from web into Oracle DB with coding gbk, I found messy code by select from PL/SQL.
I tried the way ".encode('gbk','ignore')" before insert Oracle by using cx_Oracle,but not effective.
How can I deal with the coding?

Thanks a lot
Best Regards

Kerry
2011-04-21
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110421/f18cf382/attachment.html>

Search Discussions

  • MRAB at Apr 21, 2011 at 3:54 pm

    On 21/04/2011 07:27, 1011_wxy wrote:
    Dear All:
    I got a coding problem when I use python to read html from web which is
    encode with gb2312,
    ater I insert the data I read from web into Oracle DB with coding gbk, I
    found messy code by select from PL/SQL.
    I tried the way ".encode('gbk','ignore')" before insert Oracle by using
    cx_Oracle,but not effective.
    How can I deal with the coding?
    It's probably better to use UTF-8 wherever possible.

    Decode to Unicode and work with Unicode strings.

    Use UTF-8 when you want to store or transmit data.

    Use another encoding _only_ if it's required by a legacy application (an
    old application which requires that encoding.).

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedApr 21, '11 at 6:27a
activeApr 21, '11 at 3:54p
posts2
users2
websitepython.org

2 users in discussion

MRAB: 1 post 1011_wxy: 1 post

People

Translate

site design / logo © 2023 Grokbase