SQLite Chinese path

Source: Internet
Author: User

Recently, sqlite3 is used. SQL statements are used to perform database operations in the same way as other databases. If you have just used sqlite3, you may find that the path contains Chinese characters, and opening fails, mainly because of the encoding method. Sqlite3 uses utf8, UTF16, and other formats, but our local encoding is not like this. You can quickly find out how to convert the feature we provide to the utf3 format.Code. They get a series of similar code. Here I provide a method to use the win api. In fact, two lines of code can be used to achieve this. First, we use multichartowidechar (ap_cp...) to convert it into a wide byte, and then use widechartomultichar (ap_utf8,...) to convert the code into utf8 format. The two APIs can convert character formats into many. For more information, see the description in msdn.

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.