Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'oct': 0.02; ':-)': 0.06; 'python': 0.08; 'encoding.': 0.09; 'interpreter.': 0.09; 'subject:string': 0.09; 'utf-8': 0.09; 'subject:Unicode': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.16; 'bytes': 0.18; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.22; 'assume': 0.22; 'header :In-Reply-To:1': 0.22; 'received:209.85.212.46': 0.23; 'received :mail-vw0-f46.google.com': 0.23; 'pm,': 0.24; 'byte': 0.24; 'string': 0.26; '27,': 0.29; 'interpret': 0.29; 'unicode': 0.29; 'cc:addr:python.org': 0.30; 'represents': 0.32; 'does': 0.32; 'message-id:@gmail.com': 0.34; 'received:209.85.212': 0.34; 'test': 0.34; 'reference': 0.35; 'johnson': 0.35; 'object': 0.35; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'received:192': 0.39; 'header:Mime-Version:1': 0.39; 'case': 0.39; 'header:Message-Id:1': 0.61; 'thousand': 0.74; 'encoding,': 0.84; 'received:192.168.8': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=1RNfyVvePDcrIP42mXxMv/xbTaUXBdcPl7bNSxEItrI=; b=hbzIi50UyEF67QEOoS+AU56T0eN4x65VKFrkwFZUzjHPihHEHBK/4nhd4SZsDfhKnG vdzwmKEQpekO+BkIcHpr4owH/gi4kw1uE9pA8ZdrM6vaeEfJldAElEaKC3v18yw/f2Qx xhWmBb7dXMFK1sOfsL6xL623jKjQrT5fwfo+A= Subject: Re: Unicode literals and byte string interpretation. Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=utf-8 From: David Riley In-Reply-To: <8de0e9b7-aaac-44a4-8a07-9c1a20bfc3eb@s7g2000yqa.googlegroups.com> Date: Thu, 27 Oct 2011 23:37:01 -0400 Content-Transfer-Encoding: quoted-printable References: <8de0e9b7-aaac-44a4-8a07-9c1a20bfc3eb@s7g2000yqa.googlegroups.com> To: Fletcher Johnson X-Mailer: Apple Mail (2.1251.1) Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1319773026 news.xs4all.nl 6889 [2001:888:2000:d::a6]:50519 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15083 On Oct 27, 2011, at 11:05 PM, Fletcher Johnson wrote: > If I create a new Unicode object u'\x82\xb1\x82\xea\x82\xcd' how does > this creation process interpret the bytes in the byte string? Does it > assume the string represents a utf-16 encoding, at utf-8 encoding, > etc...? >=20 > For reference the string is =E3=81=93=E3=82=8C=E3=81=AF in the = 'shift-jis' encoding. Try it and see! One test case is worth a thousand words. And Python = has an interactive interpreter. :-) - Dave=