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


Groups > comp.lang.python > #34971

Re: Unicode

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <tolidtm@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.023
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'retrieved': 0.05; 'try:': 0.07; 'python': 0.09; 'url:%s': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.10; 'encoding': 0.15; 'file,': 0.15; 'printing.': 0.16; 'subject:Unicode': 0.16; 'url:mi': 0.16; 'urllib': 0.16; '(or': 0.18; 'respective': 0.20; 'received:209.85.214.174': 0.21; 'cc:2**0': 0.23; 'insert': 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'possibly': 0.27; 'message-id:@mail.gmail.com': 0.27; 'post': 0.28; 'source': 0.29; 'error': 0.30; 'received:google.com': 0.34; 'text': 0.34; 'received:209.85': 0.35; 'except': 0.36; 'skip:u 20': 0.36; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'received:209.85.214': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'url:index': 0.61; 'here': 0.65; 'url:cgi': 0.65; 'entry,': 0.84; 'opener': 0.84; 'stored,': 0.84; 'url:lang': 0.84; 'url:biz': 0.91; 'url:fr': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rlrrpXr1q3XJp4XhfrcIoXw4YA/nwhhJBIPTw0Cp0BY=; b=s9KbrzCEuBLUy6h+MmLPqz3zyW1CSWPXsuTbnhkbJ5s2JK20GJ4QDjGkUK3Y4l99vk wGeWapcFz/v0ypftEUi1DiF74f3FZalS+R78KcUX8kHISBWm4LP9huc/m02d+1993pOh FDmM89DEtwyZrNUj7XMi9bdZnNvaygX3h59K3lQpzb57dcWgbFbbwWOMMM/+uPpZ4uYb 7DSKOrBPr/xx02XD7bBHhoH01dh/xtaQXXu8tovnYOxJSNylT5uO0v3hKbJkqCZFkd9p JMBkFGgos3CDSDHpPGmTHzWPNCI0goAq4UZPkkD45/iQCnCb06+xa1G79DgTn0IeZRYJ VjvQ==
MIME-Version 1.0
In-Reply-To <CAHzaPEPigppu_OGO+oujXJXNxtq++GeQcPAqOPnwfegC8dE+Tg@mail.gmail.com>
References <mailman.941.1355692240.29569.python-list@python.org> <50ceb674$0$29868$c3e8da3$5496439d@news.astraweb.com> <CAKhY55MLBeT-xLwqy59gusU3H2o_pceLKDxY-8XVifU_Ns2yrg@mail.gmail.com> <CAMuTYXis2vH5xjmHAgrESquPDQsAYWkzFnWGfDeyE9K5-Nwiww@mail.gmail.com> <CAKhY55OE+FdjR-EyXToE5TuWEMLwAi4n-NeuFhtKnOtZ=ey2DA@mail.gmail.com> <CAHzaPEM_sp=0aEtbxVPYYvea=_DuE36P9ZwtNGAVjnXCaykNaw@mail.gmail.com> <CAKhY55P3x9-WS52D5i+E+rJ7y2osGHnqTZwB2TpBK4zUSe0ouw@mail.gmail.com> <CAHzaPEPigppu_OGO+oujXJXNxtq++GeQcPAqOPnwfegC8dE+Tg@mail.gmail.com>
Date Mon, 17 Dec 2012 12:14:09 +0100
Subject Re: Unicode
From Anatoli Hristov <tolidtm@gmail.com>
To Vlastimil Brom <vlastimil.brom@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.956.1355742852.29569.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1355742852 news.xs4all.nl 6986 [2001:888:2000:d::a6]:39720
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34971

Show key headers only | View raw


> this seems to be an encoding error of your terminal on printing.
> You may need to describe (or better post the respective parts of the
> source) where the text is coming from (external text file, database
> entry, harcoded in the python source ...), how it is stored, retrieved
> and possibly manipulated before you insert it to the database.
>
Here is how I get the data using the urllib opener:

def GetSpecsFR(icecat_prod_id):
    opener = urllib.FancyURLopener({})
    ffr = opener.open("http://prf.icecat.biz/index.cgi?product_id=%s;mi=start;smi=product;shopname=openICEcat-url;lang=fr"
% icecat_prod_id)
    specsfr = ffr.read()
    #specsfr = specsfr.decode('utf-8')
    specsfr = RemoveHTML(specsfr)
    ##specsfr = "%r" % specsfr
##    if specsfr:
##        try:
##            specsfr = str(specsfr)
##        except UnicodeEncodeError:
##            specsfr = str(specsfr.encode('utf-16'))
    return specsfr

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-16 22:10 +0100
  Re: Unicode Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-17 06:06 +0000
    Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 09:59 +0100
    Re: Unicode Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-12-17 01:28 -0800
    Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 10:45 +0100
    Re: Unicode Vlastimil Brom <vlastimil.brom@gmail.com> - 2012-12-17 11:02 +0100
    Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 11:17 +0100
    Re: Unicode Vlastimil Brom <vlastimil.brom@gmail.com> - 2012-12-17 11:55 +0100
    Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 12:14 +0100
    Re: Unicode Vlastimil Brom <vlastimil.brom@gmail.com> - 2012-12-17 12:56 +0100
    Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 18:43 +0100
    Re: Unicode Dave Angel <d@davea.name> - 2012-12-17 13:07 -0500
    Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 19:36 +0100
      Re: Unicode Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-18 00:07 +0000
    Re: Unicode Vlastimil Brom <vlastimil.brom@gmail.com> - 2012-12-17 20:55 +0100
    Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 21:00 +0100
    Re: Unicode Dave Angel <d@davea.name> - 2012-12-17 16:09 -0500
      Re: Unicode Hans Mulder <hansmu@xs4all.nl> - 2012-12-17 23:02 +0100
        Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 23:33 +0100
    Re: Unicode Terry Reedy <tjreedy@udel.edu> - 2012-12-17 17:03 -0500
    Re: Unicode Anatoli Hristov <tolidtm@gmail.com> - 2012-12-17 23:31 +0100

csiph-web