Today, after successfully installing pydev with eclipse, try to run it. Since the creation date of the file contains Chinese characters by default, the Unicode error as shown in the figure appears after running
Online solutions to find two, and then I have derived a third (focus). The method is as follows
Method 1: File & gt& gt; Properties>& gt; Text file encoding>& gt; O ther:utf-8
After completing the above steps, there will be garbled code, delete and re-enter Chinese characters can be normal operation!
Method 2: edit & gt& gt; Set Encoding & gt;& gt; O ther:utf-8 (the same as the method one by one, there will be garbled codes. Just delete them and input them again.)
Method 3: right click on the python project/Package & gt& gt; Properties and method 1 are similar operations
The first two methods are both temporary but not permanent, that is, they can only solve the Unicode error of the current file, and a new Python file will still have a Unicode error; After using method 3, as long as the file is created under the project, its encoding is UTF-8, and there will be no Unicode It solves the problem from the root.
Method 3: discovery process
In method 1, in properties & gt& gt; In run/debug setting, I found that the current code setting object is only the current file, so I thought of giving it to the whole python Project to set the encoding, so right-click the mouse on the project, found the projperties option, according to the operation of method 1 to try, successfully solved the Unicode problem So there is method 3
Read More:
- Solution of Unicode decodeerror -‘utf-8 ‘codec can’t decode byte 0xc4 in position 0 – invalid continuation byte
- UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xc3 in position 54: invalid continuation byte
- When reading the CSV file with Python 3, the Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd0 in position 0: invalid con appears
- Solve the ‘UTF-8’ codec can’t decode byte 0xe9 in position 3114: invalid continuation byte error
- Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0x80 in position 3131: invalid start byte solution
- UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd6 in position 3089: invalid continuation byte
- Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd3 in position 238: invalid continuation B
- Successfully resolved Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd3 in position 238: invalid continuation B
- ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)
- python SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: trunca
- Python SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3:
- Syntax Error: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position resolution
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- How to solve the problem of syntax error: (Unicode error)’unicodescape ‘codec can’t decode bytes in position 2-3: truncat
- Eclipse PyDev “interpreter does not exist in filesystem”
- UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-2: ordinal not in range(128)
- Fatal Python error: Py_Initialize: unable to load the file system codec.
- Fatal Python error: initfsencoding: unable to load the file system codec
- After eclipse eclipse eclipse imports the correct project, an error is reported in XML and other files