On u'Unicode string literals' (Py3)

D

Dave Angel

Just who are you replying to?

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.
'2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]'

Why then does the subject line say Py3 ?

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.
 
J

jmfauth

For those who do not know:
The u'' string literal trick has never worked in Python 2.

'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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top