Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'win32': 0.03; 'error:': 0.05; 'python': 0.09; 'literal': 0.09; 'sep': 0.09; 'windows,': 0.09; 'gui': 0.11; 'subject:python': 0.11; '2.7': 0.13; 'library': 0.15; 'encoding': 0.15; '"u"': 0.16; '(note': 0.16; 'help?': 0.16; 'ignores': 0.16; 'mark,': 0.16; 'pyshell': 0.16; 'shell:': 0.16; 'unsupported': 0.16; 'wxpython': 0.16; 'skip:u 30': 0.17; 'unicode': 0.17; '(in': 0.18; 'shell': 0.18; '>>>': 0.18; 'input': 0.18; 'bit': 0.21; 'subject:problem': 0.22; 'header:In-Reply- To:1': 0.25; 'handling': 0.27; 'message-id:@mail.gmail.com': 0.27; 'skip:( 20': 0.28; '(unless': 0.29; 'url:mailman': 0.29; 'probably': 0.29; 'e.g.': 0.30; 'error': 0.30; 'url:python': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'builds': 0.33; 'idle': 0.33; 'traceback': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'hi,': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'needed': 0.35; 'built-in': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'url:org': 0.36; 'characters': 0.36; 'limitation': 0.36; 'option': 0.37; 'usual': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'gives': 0.39; 'instead': 0.39; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'url:mail': 0.40; 'most': 0.61; 'charset:windows-1256': 0.61; 'solve': 0.62; 'mentioned': 0.63; 'more': 0.63; 'quotation': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=nFB1L86UpM9zdTmzYx9mihReveTQ0odmFqpjevPHdhI=; b=Mq4kgOi/Vqjlv3Xn2BFKGe8OkA/K8igACSnL+9uSD4lXZYF5+re/B3k+efZOrAtjOE lbryPODhDXHJuformobkC65Ci41tmjHaCm5UPjLeGYYfN7bRTot7epf7XMNgzTl/kjFv 50dSbTDLiV3NpkIFDy8QnLmflivzqClGeP3dDzBn/Ul1O1/7uP3wqcMTfR8Yu2E3P/NX BXnocg/MsbNAyN8AG78TiTItgDFKFXnyK80dDLDU0znWd0lRn837St+qORDEDAgt1cjC J3V3xU/jcEcaPZzksKZWOy6stJCiMwxSfr9Lcf43EyI35AXrN+6DMTzsXl38N73wA/4J TY1w== MIME-Version: 1.0 X-Received: by 10.49.128.170 with SMTP id np10mr20981142qeb.37.1362404379578; Mon, 04 Mar 2013 05:39:39 -0800 (PST) In-Reply-To: References: Date: Mon, 4 Mar 2013 14:39:39 +0100 Subject: Re: Encoding problem in python From: Vlastimil Brom To: python-list@python.org Content-Type: text/plain; charset=windows-1256 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: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362404387 news.xs4all.nl 6934 [2001:888:2000:d::a6]:43388 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40446 2013/3/4 : > I have a problem with encoding in python 27 shell. > > when i write this in the python shell: > > w=3Du'=C7=E1=DA=D1=C8=EC' > > It gives me the following error: > > Unsupported characters in input > > any help? > -- > http://mail.python.org/mailman/listinfo/python-list Hi, I guess, you are using the built-in IDLE shell with python 2.7 and this is a specific limitation of its handling of some unicode characters (in some builds and OSes - "narrow"-unicode, Windows, most likely?) and its specific error message - not the usual python traceback mentioned in other posts). If it is viable, using python 3.3 instead would solve this problem for IDLE= : Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> w=3D'=C7=E1=DA=D1=C8=EC' >>> w '=C7=E1=DA=D1=C8=EC' (note the missing "u" in unicode literal before the starting quotation mark, which would be the usual usage in python 3, but python 3.3 also silently ignores u"..." for compatibility.) >>> w=3Du'=C7=E1=DA=D1=C8=EC' >>> w '=C7=E1=DA=D1=C8=EC' >>> If python 2.7 is required, another shell is probably needed (unless I am missing some option to make IDLE work for this input); e.g. the following works in pyshell - part of the wxpython GUI library http://www.wxpython.org/ >>> w=3Du'=C7=E1=DA=D1=C8=EC' >>> w u'\u0627\u0644\u0639\u0631\u0628\u0649' >>> print w =C7=E1=DA=D1=C8=EC >>> hth, vbr