Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'encoding': 0.05; 'subject:text': 0.05; 'laura': 0.07; 'see:': 0.07; 'utf-8': 0.07; 'aliases': 0.09; 'creighton': 0.09; 'url:unicode': 0.09; 'subject:question': 0.10; 'cc:addr:python-list': 0.11; '>in': 0.16; 'received:openend.se': 0.16; 'received:theraft.openend.se': 0.16; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'header:In-Reply- To:1': 0.27; 'cc:2**2': 0.30; '+0100,': 0.31; 'writes:': 0.31; 'url:python': 0.33; 'cc:no real name:2**1': 0.33; 'problem': 0.35; 'there': 0.35; 'i.e.': 0.36; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'does': 0.39; 'read': 0.60; 'dave': 0.60; "you'll": 0.62; 'header:Message-Id:1': 0.63; 'url:4': 0.69; '2015': 0.84; 'received:89': 0.85; 'angel': 0.91 To: Laura Creighton From: Laura Creighton Subject: Re: Newbie question about text encoding In-Reply-To: Message from Laura Creighton of "Tue, 24 Feb 2015 15:55:41 +0100." <201502241455.t1OEtffT016452@fido.openend.se> References: <54EC5FA4.6070703@davea.name><201502241455.t1OEtffT016452@fido.openend.se> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18599.1424790379.1@fido> Date: Tue, 24 Feb 2015 16:06:19 +0100 Cc: python-list@python.org, lac@openend.se 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424790392 news.xs4all.nl 2882 [2001:888:2000:d::a6]:33589 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86322 In a message of Tue, 24 Feb 2015 15:55:41 +0100, Laura Creighton writes: >In a message of Tue, 24 Feb 2015 06:25:24 -0500, Dave Angel writes: >>But utf-8 does not seem to be the right encoding for that bytestring. >>So you'll need a form like: >> mystring = rec.decode(encoding='xxx') >> >>for some value of xxx. > >>DaveA > >And the xxx you want is "latin1" > >Laura er, latin1. You don't want an extra set of quotes. There are many aliases for latin1. i.e. latin_1, iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1 see: https://docs.python.org/2.4/lib/standard-encodings.html and you might want to read https://docs.python.org/2/howto/unicode.html to understand the problem better. Laura