Sqlite3 command line View Chinese garbled problem resolution

Source: Internet
Author: User
Tags sqlite sqlite database

The SQLite library contains a command line named Sqlite3, which allows the user to manually enter and execute SQL commands for the SQLite database. The database we create through the program is typically located in the package/databases of the content class where the/data/data/program DB is set, and the Sqlite3 database name can be entered into the SQL command line mode for database operation under this path.

If not set, the Command Line window to query the time, the Chinese display as garbled. This is because the default character set for CMD is GBK, and the default encoding used by Sqllite is Utf-8

If we solve this problem, we have the following two ways

"1" Command Setup method:

(1) Exit DOS or re-open the cmd window and enter:

[HTML]View Plaincopy
    1. Chcp 65001

And then enter OK
Note 65001 is the encoding setting for Unicode (UTF-8) 65001, Chinese Simplified (GB2312) is set to 936
(2) Right-click on the command line title bar and select "Properties"-"font" to change the font to "Lucida Console". Select the current window is valid or apply to all windows
"2" registry setting method:

(1) Open Registry Editor (regedit), expand to the following location
Hkey_current_user\console\%systemroot%_system32_cmd.exe
To modify a codepage entry to a decimal value
437 (English),
65001 (Utf-8),
936 (GBK).
This will allow you to open cmd after the character set will be modified. The character set, which is changed with the CHCP command, becomes the default value after the new CMD window is opened.

(2) Right-click on the command line title bar and select "Properties"-"font" to change the font to "Lucida Console". Select the current window is valid or apply to all windows


To supplement the use of the CHCP command:

[Plain]View Plaincopy
    1. chcp function: Toggle character format
    2. CHCP 65001 #换成utf-8 code page
    3. CHCP 936 #换成默认的gbk
    4. CHCP 437 #美国英语
    5. The general default is GBK,

Sqlite3 command line View Chinese garbled problem resolution

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.