Vs2013 Created in python file , When there is no Chinese input in the file , Encoded as utf-8 Of , Pictured

next , After inputting a few lines of Chinese in it , Use... Again notepad++ Look at the code as follows , stay vs It also reports an error when running under ( use cmd It doesn't work ):

Based on experience , This is the problem of character encoding , Try to python The transformation of the document into utf-8 Of , Directly in notepad++ Turn up utf-8  nothing bom coded , preservation , open vs, Here are some tips

Don't choose here no Well , Otherwise, the following similar errors may be prompted

If there's a hint , Direct closure , otherwise ,vs This file will be saved as ascii Format

solve vs2013 I created python file , To other platforms ( Such as linux) Chinese garbled code ( Or run the times SyntaxError: (unicode error) 'utf-8' codec can't decode byte...) More articles about

  1. Python in import Module times SyntaxError: (unicode error)utf-8 codec can not decode The wrong solution

    The old ape had a pass UE edit ( Other text editors have similar problems ) Of bmi.py file , stay Python Idle There is no problem when the environment opens the file , but import Times wrong : SyntaxError: (unicode erro ...

  2. Python error: ascii’/'utf-8′ codec can’t decode byte 0xb8 in position 50: ord

    The string uses a fee ascii Encoded character , That's what it stands for 16 The code of decimal is more than 127. To solve this problem, you can use the following method to solve , It's just setting the default encoding .python 2.x The default encoding for is ascii, If instead utf-8 ...

  3. Unexpected error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd2 in position 69: ordinal not in range(128)- terms of settlement

  4. Local file program script upload linux System Chinese garbled problem

    # Use notepad++ Editor open , Change the format and save , Then upload it

  5. Django function Admin Page appears UnicodeDecodeError: 'gbk' codec can't decode byte XXXX resolvent

    Specific error information Traceback (most recent call last): File "D:\Anaconda3\lib\site-packages\django\core\hand ...

  6. [Python] Compile error : Coding errors (SyntaxError: (unicode error) )

    1 error message python file 1 #coding:utf-8 2 3 class Clz: 4 def func(filePath): 5 """ 6 func 7 - ...

  7. The solution is in use gensim.models.word2vec.LineSentence Error in loading corpus UnicodeDecodeError: 'utf-8' codec can't decode byte...... The problem of

    stay window Next use gemsim.models.word2vec.LineSentence Load the Chinese Wikipedia corpus ( Have participle ) Times the following mistakes : UnicodeDecodeError: 'utf-8' cod ...

  8. Python: appear UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 0: invalid continuation byte problem

    I'm importing a csv There was a problem with the file The content of the error report is like this : UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in positio ...

  9. 【python】python Error reading file UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte sequence

    python Error reading file UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 2: illegal multibyte ...

Random recommendation

  1. sql server Optimization of multiple row column transposition

    Will table 1 Turn it into a table 2: surface 1 surface 2 Get the table 2 Result , It takes many times pivot transformation , Re menstruation union Connect together , The code is as follows : ] from ( select 'a' as type, * from Table_1 ...

  2. Splay

    #include <cstdio> #include <iostream> using namespace std; *1e5;//nil Represents a node that does not exist ][],flag[] ...

  3. SiteMesh Learning notes

    SiteMesh It's a lightweight web Application framework , Realized Decorator Pattern . Its goal is to reference multiple pages jsp The page is loaded into the corresponding jsp In file . In our project , Every jsp You need to add two top and ...

  4. About java Thread pool Ⅱ

    The last one translated the main part of thread pool api, After a period of study , Here's a record of this period of time jdk Learning outcomes with thread pool . For the sake of illustration , Let's start with a class diagram , It includes jdk Thread pool is mainly related to the class , In order to be clear, we have removed part of the dependence and relationship ...

  5. Boost Library installation and use

    Boost The library is very good , So I installed it today . Boost Library is not C++ Part of the standard library ( It is said that in the next version of C++ Standards will adopt it ), But it has some very practical functions that the standard library doesn't have , Like what I really need ...

  6. java web Read the image under the specified drive letter ( Two )

    I wrote an article about how to read the picture under the specified drive letter , Although the function can be realized , But here's the thing I/O stream , The efficiency is not high . Now there's a better way , It's more convenient to use . We know , When our picture is placed in tomcat Next web ...

  7. Java getResourceAsStream Return the empty question

    Use getResourceAsStream("helloworld.propterties") Read the file stream, Return is always empty , Try this one .properties Files in Many ways ...

  8. arcgis api for js Introduction development series 12 map printing (GP service )

    The last one realized demo The map statistics of , Map printing is added in this article , The screenshot is as follows : (1) The idea of map printing is as follows : First, create a good map and print it GP Model , Set the parameters of the model : The second is to verify the model and run the model : And then it's publishing maps, printing GP service : Last ...

  9. STL Binary search in

    This article is reproduced in https://blog.csdn.net/riba2534/article/details/69240450 Pay attention to : Must be used in non decreasing intervals The principle of binary search is very simple , But in the written code ...

  10. if Choose the sentence and switch Comparison of choice statements 、 Differences and application scenarios

    if Select statements and switch Comparison of choice statements : 1.switch Statement only supports branch judgment with constant values equal , and if Statement support is more flexible , Any Boolean expression can : 2.switch A statement is usually better than a series of nested statements if More efficient sentences : The logic is more ...