Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'cpython': 0.05; 'encoded': 0.07; 'subject:file': 0.07; 'utf-8': 0.07; 'locale': 0.09; 'subject:How': 0.10; 'windows': 0.15; '(should': 0.16; 'filesystem': 0.16; 'name).': 0.16; 'wrote:': 0.18; 'settings': 0.22; 'saying': 0.22; 'header:User-Agent:1': 0.23; 'header:In- Reply-To:1': 0.27; 'character': 0.29; "can't": 0.35; 'created': 0.35; 'received:google.com': 0.35; 'subject:data': 0.36; 'subject:?': 0.36; 'message-id:@gmail.com': 0.38; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'incoming': 0.72; 'subject:this': 0.83; '3.3.1': 0.84; '9.1': 0.84; 'freebsd': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=mf+1xsD9JQv1gxkNL5mNXyWxA0aoPetitdjZs72HcC0=; b=srTYey8a8MquMFR1N9110lm0cEPVgm6FXFkUXDGewSk1ZQVej1o/mk5eJftcaV2R4x lKtIZ0/BaYQ5/Vz0djwqCO+tVLWgQ7yWFPZ4Xh1qRP4UHabYtBINS9Nz+cMbHAj6oBz5 O4M3OES2nmOPnmE5LV3D+RGXbgS+RvmZu+57VtWbP/2LCFoYzuq7nPgzrf9yY2OeNq94 WsjM3d7wGFZEP2wquVPbz9tsWF3PEMGejYlEuyft/fgvaiyvQPtYZyM1E9wvQ6afxT1W hf95hdobNcL3rWSe4GgGdz5bQgiAxqH82nntNzjUMUFHNFCCldpbiVg1su6ElXACo+nr PXIw== X-Received: by 10.50.25.102 with SMTP id b6mr6955892igg.27.1367230273921; Mon, 29 Apr 2013 03:11:13 -0700 (PDT) Date: Mon, 29 Apr 2013 05:11:11 -0500 From: Andrew Berg User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: "comp.lang.python" Subject: Re: How do I encode and decode this data to write to a file? References: <27s15a-943.ln1@chris.zbmc.eu> In-Reply-To: <27s15a-943.ln1@chris.zbmc.eu> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367230281 news.xs4all.nl 15957 [2001:888:2000:d::a6]:54841 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44490 On 2013.04.29 04:47, cl@isbd.net wrote: > If I understand correctly the encode() is saying that it can't > understand the data in the html because there's a character 0xc3 in it. > I *think* this means that the é is encoded in UTF-8 already in the > incoming data stream (should be as my system is wholly UTF-8 as far as I > know and I created the directory name). You can verify that your filesystem is set to use UTF-8 with sys.getfilesystemencoding(). If it returns 'ascii', then your locale settings are incorrect. -- CPython 3.3.1 | Windows NT 6.2.9200 / FreeBSD 9.1