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


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

On u'Unicode string literals' (Py3)

Started byjmfauth <wxjmfauth@gmail.com>
First post2012-02-29 05:45 -0800
Last post2012-02-29 07:17 -0800
Articles 3 — 2 participants

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


Contents

  On u'Unicode string literals' (Py3) jmfauth <wxjmfauth@gmail.com> - 2012-02-29 05:45 -0800
    Re: On u'Unicode string literals' (Py3) Dave Angel <d@davea.name> - 2012-02-29 09:54 -0500
    Re: On u'Unicode string literals' reintroduction (Py3) jmfauth <wxjmfauth@gmail.com> - 2012-02-29 07:17 -0800

#21039 — On u'Unicode string literals' (Py3)

Fromjmfauth <wxjmfauth@gmail.com>
Date2012-02-29 05:45 -0800
SubjectOn u'Unicode string literals' (Py3)
Message-ID<92580c23-775d-4b10-9986-1b1abb1f673f@d17g2000vba.googlegroups.com>
For those who do not know:
The u'' string literal trick has never worked in Python 2.

>>> sys.version
'2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]'
>>> print u'Un oeuf à zéro EURO uro'
Un  uf à zéro  uro
>>>

jmf

[toc] | [next] | [standalone]


#21043

FromDave Angel <d@davea.name>
Date2012-02-29 09:54 -0500
Message-ID<mailman.296.1330527259.3037.python-list@python.org>
In reply to#21039
Just who are you replying to?

On 02/29/2012 08:45 AM, jmfauth wrote:
> For those who do not know:
> The u'' string literal trick has never worked in Python 2.
>

No trick there.  If you have something explicit to say, then say it.
>>>> sys.version
> '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]'

Why then does the subject line say Py3 ?

>>>> print u'Un oeuf à zéro EURO uro'

You're testing three things here, so there's no telling which might be 
wrong.  Your source encoding, the implicit str() conversion for unicode, 
and the particular terminal you're printing it on.  It'd be amazing if 
all three were right, unless you're on Linux.

> Un  uf à zéro  uro
> jmf


-- 

DaveA

[toc] | [prev] | [next] | [standalone]


#21045 — Re: On u'Unicode string literals' reintroduction (Py3)

Fromjmfauth <wxjmfauth@gmail.com>
Date2012-02-29 07:17 -0800
SubjectRe: On u'Unicode string literals' reintroduction (Py3)
Message-ID<bcf7edbc-9236-46b6-8bca-e94012f23826@w9g2000vbv.googlegroups.com>
In reply to#21039
On 29 fév, 14:45, jmfauth <wxjmfa...@gmail.com> wrote:
> For those who do not know:
> The u'' string literal trick has never worked in Python 2.
>
> >>> sys.version
>
> '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]'>>> print u'Un oeuf à zéro EURO uro'
>
> Un  uf à zéro  uro
>
>
>
> jmf


Sorry, I just wanted to show a small example.
I semms Google as "changed" again.

You should read (2nd attempt)
u'Un œuf à zéro €' with the *correct* typed glyphs 'LATIN SMALL
LIGATURE OE'
in œuf and 'EURO SIGN' in '€uro'.

jmf

[toc] | [prev] | [standalone]


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


csiph-web