Confirmed users
513
edits
Klahnakoski (talk | contribs) |
Klahnakoski (talk | contribs) |
||
| Line 170: | Line 170: | ||
Unicode, character encodings, and Python2.7 may be harder than timezones to debug if only because your terminal performs its own conversion to display the data structures you are viewing. Two lines make internationalization easier in Python2.7: | Unicode, character encodings, and Python2.7 may be harder than timezones to debug if only because your terminal performs its own conversion to display the data structures you are viewing. Two lines make internationalization easier in Python2.7: | ||
: <code># encoding: utf-8</code> at the top of every file, | : '''<code># encoding: utf-8</code>''' at the top of every file, | ||
: <code>from __future__ import unicode_literals</code> as the first import in every file | : '''<code>from __future__ import unicode_literals</code>''' as the first import in every file | ||
This makes strings unicode everywhere (well, not calls to __getattribute__, but at least they are ascii) | This makes strings unicode everywhere (well, not calls to __getattribute__, but at least they are ascii) | ||