Use eclipse to compile a python program that inserts data into the SQLite Database

Source: Internet
Author: User

I encountered the following problems today:

Compiling Python with eclipse and inserting data into the SQLite database always prompts the encoding problem. I set the eclipse workspace to use UTF-8 encoding or not.

But it is written in eclipseProgramIt's strange that I can save and use idle to open it but compile it.

 

I checked all the configurations for possible reasons, including engineering files.

 

Finally, I used xvi32 to open two identical programs (prepared by eclipse and idle respectively) and found the problem.

 

Although the file stored in eclipse is UTF-8 encoded, it does not contain/FF/BB/BF in the file header, while the idle does not have an identifier to recognize UTF-8 (default)

Eclipse does not (maybe it is the reason for my eclipse ~~!)

 

Again, the ID is automatically added for writing with idle, just like saving it with notepad UTF-8.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.