Python Unicode/lang-pt: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (fixing DIV anchors + Translated text) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Translation | lang = pt | source = Python Unicode | version = 36322}} |
|||
== Em construção == |
|||
{{Ongoing Translation}} |
|||
{{ Translated text | |
|||
Python has good [[unicode]] support, but it is not necessarily ''easy'' to use. Some things to note: |
|||
* You ''must'' test your application with real Unicode (not ASCII-encodable) text. You can miss lots of bugs if you just use normal ASCII text (i.e., a-z, no accents). |
|||
Ajude na tradução!!! |
|||
* You should be careful not to confuse 8-bit strings (that contain binary data and are of type "str"), and text (that contains unicode data and is of type "unicode"). It's easy to substitute one for the other, until you use non-ASCII text, then you'll get a UnicodeEncode/DecodeError. |
|||
* The [http://python.org/doc/current/lib/module-codecs.html codecs] module has some helpers for reading unicode from files. |
|||
* You can't generally write unicode to a file or the console without setting up something with codecs or another wrapper. |
|||
| display = block }} |
|||
{{anchor|Resources}} |
|||
==Resources== |
|||
{{ Translated text | |
|||
Some resources to learn about [[Unicode]]: |
|||
* [http://joelonsoftware.com/articles/Unicode.html The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)] by Joel Spolsky -- general Unicode information |
|||
* [http://www.amk.ca/python/howto/unicode Unicode HOWTO] by Andrew M Kuchling -- Python unicode help |
|||
* [http://www.jorendorff.com/articles/unicode/python.html Unicode in Python] by Jason Orendorff -- some more Python help |
|||
* [http://www.tutorialsall.com/PYTHON/ascii-latin/ ascii to latin1] (and back again). A thread about searching unicode text, so that for example a search for "televisao" matches "televisão" |
|||
* [http://unicode.org/faq/normalization.html Normalization FAQ] (not Python-specific) -- a single unicode string can be encoded multiple ways via "surrogates". This introduces ambiguity. This talks about some of that. |
|||
* [http://pylonshq.com/docs/0.9.4/internationalization.html The Pylons Internationalization document] has a lot of information that is generally applicable to Python. |
|||
| display = block }} |
|||
[[Category:Developers]] |
|||
[[Category:Language support]] |
|||
[[Category:Languages (international)]] |
|||
[[Category:Python]] |
Latest revision as of 23:12, 7 June 2007
Tradução de Python Unicode | original |
english | português | español +/- | alterações |
- This is an on-going translation
Python has good unicode support, but it is not necessarily easy to use. Some things to note:
- You must test your application with real Unicode (not ASCII-encodable) text. You can miss lots of bugs if you just use normal ASCII text (i.e., a-z, no accents).
- You should be careful not to confuse 8-bit strings (that contain binary data and are of type "str"), and text (that contains unicode data and is of type "unicode"). It's easy to substitute one for the other, until you use non-ASCII text, then you'll get a UnicodeEncode/DecodeError.
- The codecs module has some helpers for reading unicode from files.
- You can't generally write unicode to a file or the console without setting up something with codecs or another wrapper.
Resources
Some resources to learn about Unicode:
- The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) by Joel Spolsky -- general Unicode information
- Unicode HOWTO by Andrew M Kuchling -- Python unicode help
- Unicode in Python by Jason Orendorff -- some more Python help
- ascii to latin1 (and back again). A thread about searching unicode text, so that for example a search for "televisao" matches "televisão"
- Normalization FAQ (not Python-specific) -- a single unicode string can be encoded multiple ways via "surrogates". This introduces ambiguity. This talks about some of that.
- The Pylons Internationalization document has a lot of information that is generally applicable to Python.