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


Groups > comp.lang.python > #91460

Re: Fwd: Lossless bulletproof conversion to unicode (backslashing) (fwd)

References (1 earlier) <CAPkN8xJxdumt1cNoistwNagUtvze-cFD2y8_3+Z4hyuTfTLmdA@mail.gmail.com> <201505290841.t4T8f9Tr014513@fido.openend.se> <techtonik@gmail.com> <CAPkN8xLz1ykBXSxEp+jrURgEGkubcnq2CCbrxkpmQvUhcPOvOQ@mail.gmail.com> <201505291139.t4TBd0XE018889@fido.openend.se>
From anatoly techtonik <techtonik@gmail.com>
Date 2015-05-29 17:41 +0300
Subject Re: Fwd: Lossless bulletproof conversion to unicode (backslashing) (fwd)
Newsgroups comp.lang.python
Message-ID <mailman.182.1432910518.5151.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, May 29, 2015 at 2:39 PM, Laura Creighton <lac@openend.se> wrote:
> Do you know about the codecs module?
>
> reading http://pymotw.com/2/codecs/ may be useful if this is new to you.

Does that work for Python 2 and Python 3?

> Have you read https://www.python.org/dev/peps/pep-0293/ ?

No.

> Will backslashreplace do what you want?

I don't know. I am sorry, but what is there the code that
does this:

  binary -> escaped utf-8 string -> unicode -> binary

I know about coding module, but I am not seeing a solution
to crash-proof output from Python. Is inserting a custom codec
class into every piece of code that I want to debug is the only
solution?
-- 
anatoly t.

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


Thread

Re: Fwd: Lossless bulletproof conversion to unicode (backslashing) (fwd) anatoly techtonik <techtonik@gmail.com> - 2015-05-29 17:41 +0300

csiph-web