13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Internationalizationhttp://www.zetcode.com/wxpython/in18/Python IDEHome ContentsFaster, Easier Python Development Editor,Debugger, Browser, and moreFree PHP ExamplesEdit & Debug Your PHP Applications LearnPHP by Example with PhpEDInternationalizationIn computing, Internationalization and localization are means ofadapting computer software for non-native environments,especially other nations and cultures. Internationalization is theprocess of ensuring that an application is capable of adapting tolocal requirements, for instance ensuring that the local writingsystem can be displayed. Localization is the process of adaptingthe software to be as familiar as possible to a specific locale, bydisplaying text in the local language and using local conventionsfor the display of such things as units of measurement.(wikipedia)Unicode<strong>The</strong>re are two builds of <strong>wxPython</strong>. <strong>The</strong> ansi build and the unicodebuild. If we want to create and use <strong>wxPython</strong> applications inlanguages other than english, we must have the unicode build.Unicode is an industry standard allowing computers toconsistently represent and manipulate text expressed in any ofthe world's writing systems. It is a character enconding standartwhich uses 16 bits for storing characters. <strong>The</strong> traditional ASCIIenconding uses only 8 bits.First, we need to get the unicode enconding of Лев НиколaевичТолстoй Анна Каренина words.>>> unicode(u'Лев Николaевич Толстoй Анна Каренина')u'\u041b\u0435\u0432 \u041d\u0438\u043aa\u0430\u0301\u0435\u0432\u0438\u0447\u0422\u043e\u043b\u0441o\u0439 \u0410\u043d\u043d\u0430\u041a\u0430\u0440\u0435\u043d\u0438\u043d\u0430'We launch the python terminal and use the unicode() functioncall. Notice, that in the example, we use additional \n\characters to divide the words into two lines.#!/usr/bin/python1 de 12 27/04/2008 1:06

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!