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


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

Re: to express unicode string

Started byTerry Reedy <tjreedy@udel.edu>
First post2012-01-28 18:03 -0500
Last post2012-01-28 18:03 -0500
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: to express unicode string Terry Reedy <tjreedy@udel.edu> - 2012-01-28 18:03 -0500

#19561 — Re: to express unicode string

FromTerry Reedy <tjreedy@udel.edu>
Date2012-01-28 18:03 -0500
SubjectRe: to express unicode string
Message-ID<mailman.5184.1327792744.27778.python-list@python.org>
On 1/28/2012 2:58 PM, Michael Torrie wrote:
> On 01/28/2012 12:21 AM, contro opinion wrote:
>>>>> s='你好'
>
> On my computer, s is a byte string that contains the utf-8 formatted
> encoding of 你好.

On mine, s is a (unicode) string containing those two characters. That 
is because I pasted the above into IDLE 3.2.2 (on Win7, but should be 
the same on all systems). (Pasting into the standard interpreter window, 
which uses Windows stupid Command Prompt interface, does not work.)

To the OP. if you want to work easily with unicode, use Python 3.2 now 
and Python 3.3 as soon as it comes out, in less than a year. We went 
through the hassle of changing the string type from bytes to unicode 
*because* having unicode as merely an add-on type was not working very well.

-- 
Terry Jan Reedy

[toc] | [standalone]


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


csiph-web