Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1a.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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'irc': 0.05; 'output': 0.05; 'apis': 0.09; 'subject:characters': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'windows': 0.15; '(both': 0.16; 'displaying': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'renders': 0.16; 'simplest': 0.16; 'subject:Unicode': 0.16; 'underlying': 0.16; 'unicode,': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'drawing': 0.19; 'possible,': 0.19; 'written': 0.21; 'input': 0.22; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'sorry,': 0.24; 'subject:problem': 0.24; 'unicode': 0.24; 'fine': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'logging': 0.26; '(for': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; '[1]': 0.29; 'am,': 0.29; 'url:code': 0.29; 'andrew': 0.30; 'characters': 0.30; 'message-id:@mail.gmail.com': 0.30; 'lines': 0.31; '(my': 0.31; 'font': 0.31; 'subject:some': 0.31; 'quite': 0.32; 'text': 0.33; 'plain': 0.33; 'subject:with': 0.35; 'display': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'largely': 0.36; 'problems': 0.38; 'issue': 0.38; 'little': 0.38; 'does': 0.39; 'most': 0.60; 'issues,': 0.61; "you're": 0.61; 'url:p': 0.64; 'more': 0.64; 'different': 0.65; 'between': 0.67; 'containing': 0.69; 'default': 0.69; 'abandon': 0.84; 'bot': 0.84; 'characters,': 0.84; 'distinguish': 0.84; 'fonts': 0.84; 'played': 0.84; 'technically': 0.84; 'visually': 0.84; 'worth,': 0.84; 'difficult,': 0.91; 'to:none': 0.92 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:cc :content-type; bh=wF11wFrwfjivBlpBbNZ7L4bPQj690Ege97FaEKWUtj0=; b=d+/CfZ9qqmAPiDOaZ6j7bg1HCEBHVopTgC8ZgdSPa2kiKEQEXSqXVKeqzS7uGmHkV2 obsSsAG5XXyqxvuf/QY8raSJt8Xwt4SuqxeTTxC1qvHoD/2/AwuMJeQJNWlCnoZq0Va9 ZkGUqh1MO7JvU+SWO+7hXg2WIxfSeWuOMM4Mi2M1EUvpUu+76sPY/AiKu6mAoDVBzLKY L97if3fEwHbLXnDVmFNrBsADojvrfFzO+wZUaoeMnYsF6CotmJ82lz3g9y6gMp9yzjPP MSUl/qK96LVq+X6i4Qoy3y3z5eEDq4/eKJ0mAflJZvBdCYN0iMg7A7CqcQ5yM88yERdr TkKg== MIME-Version: 1.0 X-Received: by 10.50.66.197 with SMTP id h5mr31411842igt.34.1407109175393; Sun, 03 Aug 2014 16:39:35 -0700 (PDT) In-Reply-To: <53DEC4F5.8090805@my.hennepintech.edu> References: <53DEC4F5.8090805@my.hennepintech.edu> Date: Mon, 4 Aug 2014 09:39:35 +1000 Subject: Re: cmd.exe on WIndows - problem with displaying some Unicode characters From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407109495 news.xs4all.nl 2954 [2001:888:2000:d::a6]:54742 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75631 On Mon, Aug 4, 2014 at 9:25 AM, Andrew Berg wrote: > On 2014.08.03 18:08, Chris Angelico wrote: >> The best way to do it is to use the Unicode codepage, but cmd.exe just >> plain has issues. There are underlying Windows APIs for displaying >> text that have problems with astral characters (I think that's what it >> is), so ultimately, you're largely stuck. > That is not quite true. The terminal has these issues, not the shell. Using > cp65001 does make Unicode in a Windows terminal possible, but using a better > terminal[1] makes it almost perfect (my experience has been that input can be > difficult, but output works well). I personally have used an IRC bot written in > Python with logging output containing Unicode characters that display just fine > (both locally and over SSH). > > [1] I recommend ConEmu: https://code.google.com/p/conemu-maximus5/ Sorry, yeah, my terminology was sloppy. It's not technically cmd.exe, but the default console. I just played around with a CP-437 decode of everything 128-255, rendered in various different fonts, all using my MUD client on Windows. (For what it's worth, it renders using GTK2 and Pango. But I suspect this is more a font issue than a display engine one.) Most fonts had those little boxes-with-numbers for most of the line drawing characters, but Lucida Sans Unicode, Meiryo, and Tahoma all managed to display all the characters. However, I wasn't able to visually distinguish between the single-line and double-line characters, so you may want to play around with it a bit more. Your simplest solution may still be to abandon those double lines and just go with single. ChrisA