Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24624

Re: Is there any way to decode String using unknown codec?

From Dieter Maurer <dieter@handshake.de>
Subject Re: Is there any way to decode String using unknown codec?
Date 2012-06-28 19:18 +0200
References <c67686b6-4f98-4408-a89c-edc0a6030c24@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1613.1340903908.4697.python-list@python.org> (permalink)

Show all headers | View raw


howmuchistoday@gmail.com writes:

> 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').

This looks as if "sys.stdout/sys.stderr" knew the correct encoding.
Check it like this:

      import sys
      sys.stdout.encoding

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Is there any way to decode String using unknown codec? howmuchistoday@gmail.com - 2012-06-27 18:14 -0700
  Re: Is there any way to decode String using unknown codec? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2012-06-27 19:20 -0700
    Re: Is there any way to decode String using unknown codec? howmuchistoday@gmail.com - 2012-06-28 14:27 -0700
    Re: Is there any way to decode String using unknown codec? howmuchistoday@gmail.com - 2012-06-28 14:27 -0700
  Re: Is there any way to decode String using unknown codec? MRAB <python@mrabarnett.plus.com> - 2012-06-28 12:28 +0100
  Re: Is there any way to decode String using unknown codec? Dieter Maurer <dieter@handshake.de> - 2012-06-28 19:18 +0200

csiph-web