Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'encoded': 0.05; 'linux,': 0.05; 'utf-8': 0.07; 'encode': 0.09; 'linux.': 0.09; 'url:%s': 0.09; 'cc:addr:python-list': 0.10; 'codec': 0.16; 'ordinal': 0.16; 'subject:Unicode': 0.16; 'url:mi': 0.16; 'urllib': 0.16; '>>>': 0.18; 'windows': 0.19; 'import': 0.21; '"",': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '(most': 0.27; 'message- id:@mail.gmail.com': 0.27; 'src': 0.29; 'character': 0.29; 'error': 0.30; 'file': 0.32; 'print': 0.32; 'traceback': 0.33; 'hi,': 0.33; "can't": 0.34; 'changed': 0.34; 'received:google.com': 0.34; 'received:209.85': 0.35; 'skip:u 20': 0.36; 'but': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'page': 0.38; 'header:Received:5': 0.40; 'skip:u 10': 0.60; 'url:index': 0.61; 'here': 0.65; 'url:cgi': 0.65; 'opener': 0.84; 'url:lang': 0.84; 'url:biz': 0.91; 'catalog': 0.93; '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=Skgb5QUQ2K72dI1TvzOKEAiNYX8r/jxCFYhVUbsnubc=; b=qdyc3tsYeOISriO1bpDqZyBez3ZcLvv4on/q8mJiq/6QCYaCL1jiyGWHDregETDODJ nn9dzQ2XvSHiw/Hm/Zb4zVQKthxYbne29M9PaR+yEWUgjgixX+6mlaJfcmZT8ZWe4NRg 9NZonlAGr6bcsfRJZnubV/VSOEFuOI9G7tdu4jRbS+5sB4T4vPxcAMmilivHm1MeIsuW FnixdXO9k/sz07+ZvdDj60I6RhWGeY3Kd6R7c4mp1LeFJXrPI9bWn5mU4/IF2epCUkO4 /Tr7vcFTslMKDxKzakseYNQep5E+rBOfrHwJdN0IcSQTHhJKysd0BInzbUE6qNFvzL+z uy+Q== MIME-Version: 1.0 In-Reply-To: References: <50ceb674$0$29868$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 17 Dec 2012 18:43:57 +0100 Subject: Re: Unicode From: Anatoli Hristov To: Vlastimil Brom 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355766240 news.xs4all.nl 6963 [2001:888:2000:d::a6]:56814 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34997 > Hi, > I don't know, what the product ID would look like, for this page, but > assuming, the catalog pages are also utf-8 encoded as well as the > error page I get, it should work ok; cf.: You are right, I get it work on Windows too, but not in Linux. I changed the codec of linux, but still I don't get it Here is what I get from Linux: >>> import urllib >>> opener = urllib.FancyURLopener({}) >>> ffr = opener.open("http://prf.icecat.biz/index.cgi?product_id=%s;mi=start;smi=product;shopname=openICEcat-url;lang=fr" % (14688538)) >>> src = ffr.read() >>> print src.decode("utf-8") Traceback (most recent call last): File "", line 1, in ? UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2122' in position 17167: ordinal not in range(256)