Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'broken': 0.03; 'interpreter': 0.04; 'raises': 0.07; 'sys,': 0.07; 'broken.': 0.09; 'codecs': 0.09; 'guys.': 0.09; 'subject:using': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'benjamin': 0.16; 'decode': 0.16; 'failed.': 0.16; 'korean.': 0.16; 'subject:String': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'os,': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'tried': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'received:209.85.212': 0.28; "i'm": 0.29; "skip:' 10": 0.30; 'error': 0.30; 'problem': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'wrong': 0.34; 'pm,': 0.35; 'sometimes': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'modules': 0.36; 'thank': 0.36; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'from:no real name:2**0': 0.60; 'show': 0.63; 'subject:there': 0.65; 'subject:any': 0.84; 'received:209.85.212.56': 0.91 Newsgroups: comp.lang.python Date: Thu, 28 Jun 2012 14:27:32 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=210.117.199.100; posting-account=MbgxqAoAAACiGFd80Qtwxi2J7qp6KsRy References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 210.117.199.100 MIME-Version: 1.0 Subject: Re: Is there any way to decode String using unknown codec? From: howmuchistoday@gmail.com To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: , Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1340918855 news.xs4all.nl 6912 [2001:888:2000:d::a6]:35123 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24637 T 2012=EB=85=84 6=EC=9B=94 28=EC=9D=BC =EB=AA=A9=EC=9A=94=EC=9D=BC =EC=98=A4= =EC=A0=84 11=EC=8B=9C 20=EB=B6=84 28=EC=B4=88 UTC+9, Benjamin Kaplan =EB=8B= =98=EC=9D=98 =EB=A7=90: > On Wed, Jun 27, 2012 at 6:14 PM, wrote: > > Hi > > I'm a Korean and when I use modules like sys, os, &c, > > sometimes the interpreter show me broken strings like > > '\x13\xb3\x12\xc8'. > > It mustbe the Korean "alphabet" but I can't decode it to the rightway. > > I tried to decode it using codecs like cp949,mbcs,utf-8 > > but It failed. > > The only way I found is eval('\x13\xb3\x12\xc8'). > > It raises an Error with showing right Korean. > > Is there any way to deal it being not broken? > > -- >=20 > It's not broken. You're just using the wrong encodings. Try utf-16le. Thank you guys. The problem is solved!