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


Groups > comp.lang.python > #81072 > unrolled thread

Re: python 2.7 and unicode (one more time)

Started byChris Angelico <rosuav@gmail.com>
First post2014-11-20 23:41 +1100
Last post2014-11-20 23:41 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: python 2.7 and unicode (one more time) Chris Angelico <rosuav@gmail.com> - 2014-11-20 23:41 +1100

#81072 — Re: python 2.7 and unicode (one more time)

FromChris Angelico <rosuav@gmail.com>
Date2014-11-20 23:41 +1100
SubjectRe: python 2.7 and unicode (one more time)
Message-ID<mailman.16016.1416487322.18130.python-list@python.org>
On Thu, Nov 20, 2014 at 11:35 PM, Peter Otten <__peter__@web.de> wrote:
> You don't need to change an all-ascii bytestring to unicode.
> Lo and behold:
>
>>>> "%s %s" % (u"üblich", u"ähnlich")
> u'\xfcblich \xe4hnlich'
>>>> u"%s %s" % (u"üblich", u"ähnlich")
> u'\xfcblich \xe4hnlich'
>
> Only non-ascii bytestrings mean trouble, either noisy
>

It's better to not depend on that, though. Be clear and explicit about
the difference between bytes and text, and don't try to pretend
they're the same thing, even for ASCII.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web