i am getting all the above results, but, i am unable to do the below code. i am working with py2.7.9 >>> # Unicode strings >>> S = 'A\u00c4B\U000000e8C' >>> S 'A-B-C' >>> len(S) 5
linux tutor
unread,
Feb 28, 2015, 9:27:30 AM2/28/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lamp_t...@googlegroups.com
I believe you are looking for the type object as unicode. U just need to add a u before it.
In [4]: S = 'A\u00c4B\U000000e8C'
In [5]: type(S) Out[5]: str
In [6]: S = u'A\u00c4B\U000000e8C'
In [7]: type(S) Out[7]: unicode
or
In [14]: S = 'A\u00c4B\U000000e8C'
In [15]: type(unicode(S)) Out[15]: unicode
Hope you are expecting this result.
Thanks, Santosh
linux tutor
unread,
Feb 28, 2015, 9:28:26 AM2/28/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to lamp_t...@googlegroups.com
On further understanding on why/how/when to work with unicode. Please read through the link below.