Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #3805

Re: How deal with the coding

Date 2011-04-21 16:54 +0100
From MRAB <python@mrabarnett.plus.com>
Subject Re: How deal with the coding
References <4950dabe.8450.12f76be171c.Coremail.1011_wxy@163.com>
Newsgroups comp.lang.python
Message-ID <mailman.706.1303401356.9059.python-list@python.org> (permalink)

Show all headers | View raw


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.).

Back to comp.lang.python | Previous | Next | Find similar


Thread

Re: How deal with the coding MRAB <python@mrabarnett.plus.com> - 2011-04-21 16:54 +0100

csiph-web