読者です 読者をやめる 読者になる 読者になる

Python3.2はUnicode 6.0に対応した

Python

Python has been updated to Unicode 6.0.0. The update to the standard adds over 2,000 new characters including emoji symbols which are important for mobile phones.

In addition, the updated standard has altered the character properties for two Kannada characters (U+0CF1, U+0CF2) and one New Tai Lue numeric character (U+19DA), making the former eligible for use in identifiers while disqualifying the latter. For more information, see Unicode Character Database Changes.

http://docs.python.org/dev/whatsnew/3.2.html#unicode

ということなので、絵文字のデータも入っているらしい。

% python3
Python 3.2rc2 (r32rc2:88266, Feb  6 2011, 23:50:56) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import unicodedata
>>> unicodedata.name("\U0001f300")
'CYCLONE'

同じ事をPython2.6でやると、

% python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import unicodedata
>>> unicodedata.name(u"\U0001f300")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: no such name

⊂(  ⊂ _・_) .。oO (だからと言って何か楽になる気がしない・・・