Python 3 , .. .py UTF-8.
☞ Python 2, .py ASCII. Python 3 UTF-8.
, . , windows-1252 :
# -*- coding: windows-1252 -*-
, Python.
#!/usr/bin/python3
# -*- coding: windows-1252 -*-
PEP 263: Defining Python Source Code Encodings.
- On Unicode in Python:
- Python Unicode HOWTO
- Whats New In Python 3: Text vs. Data Instead Of Unicode vs. 8-bit
- PEP 261 explains how Python handles astral characters outside of the Basic Multilingual Plane (i.e. characters whose ordinal value is greater than 65535)
- On Unicode in general:
- The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and * Character Sets (No Excuses!)
- On the Goodness of Unicode
- On Character Strings
- Characters vs. Bytes
- On character encoding in other formats:
- Character encoding in XML
- Character encoding in HTML
- On strings and string formatting:
- string Common string operations
- Format String Syntax
- Format Specification Mini-Language
- PEP 3101: Advanced String Formatting
❝ , : , . ❞ Jamie Zawinski
. Python, : index(), find(), split(), count(), replace() .. . index() . s, s.lower() s.upper() . replace() split() .
, . , , , . if , split() join() , .
( ) , . (. . perl), . , .
( Perl, JavaScript, PHP), Python- . re . |
⁂