Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin.stu.neva.ru!news2.euro.net!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.050 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'subject:error': 0.11; '"import': 0.16; '11:32': 0.16; 'benjamin': 0.16; 'correctly,': 0.16; 'subject:unicode': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'windows': 0.19; 'seems': 0.23; 'least': 0.25; 'header:In-Reply- To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'code': 0.31; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'nov': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'characters': 0.36; 'option': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'console,': 0.84; 'oscar': 0.84; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=XiZUyIUInixe9sTOCcLtUCIR09S8byNXW1gYOo3XxwU=; b=LotJURKgrGFzlOaJ7yMlOFV0tn5nc+Y3r7YJinVt0zFe0KsgZDL0s3dt/w9sQTddjQ vHWY3gIR0t3S52JpZoqO7UZzOYW7nbPX0wxlK0TSAVasZCCECKf8/bvKQ510tyNUcfn2 FWkYxt18shv56L6fxSlkjJ25CEleyLurIiXuYv/OPlNW7ci6NjuprCKnB+swXVPxPKAr a0M8Nx/KuGCpxoGEWkhIoRw78FJQZiTIh1DpaA72cJ5F64UobxhAt/oKYj5Zg6yJKGg9 O6DTGCx2yDADJ9rsEJQlKfQPMetiFVISVtome4AaaSh8OGdwlAYkOKbj/u6hTv1sgnV2 hNOQ== MIME-Version: 1.0 In-Reply-To: References: <09a3d20b-5871-47f4-9218-df119698e405@m4g2000yqf.googlegroups.com> <509AF3EF.8050108@gmail.com> <65910cea-f145-409c-a579-9f0cda499546@googlegroups.com> From: Ian Kelly Date: Thu, 8 Nov 2012 11:48:23 -0700 Subject: Re: Right solution to unicode error? To: Python Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352400535 news.xs4all.nl 6876 [2001:888:2000:d::a6]:45983 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32972 On Thu, Nov 8, 2012 at 11:32 AM, Oscar Benjamin wrote: > If I want the other characters to work I need to change the code page: > > O:\>chcp 65001 > Active code page: 65001 > > O:\>Q:\tools\Python33\python -c "import sys; > sys.stdout.buffer.write('\u03b1\n'.encode('utf-8'))" > =CE=B1 > > O:\>Q:\tools\Python33\python -c "import sys; > sys.stdout.buffer.write('\u03b1\n'.encode(sys.stdout.en > coding))" > =CE=B1 I find that I also need to change the font. With the default font, printing '\u2013' gives me: =C3=A2=E2=82=AC=E2=80=9C The only alternative font option I have in Windows XP is Lucida Console, which at least works correctly, although it seems to be lacking a lot of glyphs.