This document describes how to perform unicode ascii encoding. To solve the problem of Python unicode ascii encoding in windows, * nix. In this actual operation step, if you have any questions about the operation steps, you can browse the following articles.
ASCII is the abbreviation of AmericanStandardCodeforInformationInterchange. It is used to develop the code corresponding to each symbol in the computer. It is also called the code of the computer ). Each ASCII code is stored in 1 Byte. from 0 to 127 represents different common symbols. For example, the ASCII code of uppercase A is 65, and that of lowercase a is 97.
Because the seven ASCII bytes and the highest bit are not used, the highest bit is later incorporated into this set of incode to become the ExtendedASCII code of the Eight-bit, this internal code, coupled with many foreign languages and tables and other special symbols, has become a commonly used internal code.
Python unicode ascii encoding in windows, * nix issues unless your English is good enough or is it related to Chinese, I will definitely use Chinese in python code anyway, code that can run well in windows should not run well in * nix,
The following code
- #! /Usr/bin/env python
- # Coding = UTF-8
- Rint u "Beijing". encode ("gbk", 'ignore ')
It works well in windows, but not in * nix, because by default, windows programs run the ascii mechanism, and in * nix, for example, I use unicode in ubuntu, therefore, in ubuntu
Print "Beijing"
That's it. It's time to save trouble,
Note: Here Your pythonunicode ascii encoding is UTF-8 in the script file.
I later found some links to related articles, which are only listed here and not verified.
Python Chinese encoding in Linux. _ Tianya blog _ all knowledgeable people are here _ Tianya community
- It is easy to install Python.
- Analysis of Python source code
- For Python beginners
- Steps for converting url encoding in Python
- Why mod_python outperforms traditional CGI in terms of performance
I want to use UTF8 encoding in the source code when writing Python programs in Windows. How can this problem be solved?
String and unicode in Python (1)-java_jing logs-Netease blog
Python character encoding conversion _ Grand Theft/Paulau python encoding conversion-this Blog is very powerful-Blog Park Python character encoding conversion tips-hand Chen strategy-BlogJava
[Python learning] Unicode and encoding processing experience-limodou learning history-DonewsBlog
UTF-8 and Unicode FAQ about the conversion of Chinese encoding-PYTHON miscellaneous-away from the rest of the world ......
[Learning] python coding and conversion knowledge-tracking with dreams
In Python, converting any encoded string to Unicode encoding at Python + C = Nuclear or above is an introduction to the actual operation steps of the Python unicode ascii encoding.