Psql when prompted:
Perl:warning:Setting locale failed.
Perl:warning:Please Check that your locale settings:
LANGUAGE = "En_hk:en",
lc_all = (unset),
lc_paper = "en _cn. UTF-8 ",
lc_address =" ZH_CN. UTF-8 ",
lc_monetary =" ZH_CN. UTF-8 ",
lc_numeric =" ZH_CN. UTF-8 ",
lc_telephone =" ZH_CN. UTF-8 ",
lc_identification =" ZH_CN. UTF-8 ",
lc_measurement =" ZH_CN. UTF-8 ",
lc_time =" ZH_CN. UTF-8 ",
lc_name =" ZH_CN. UTF-8 ",
LANG =" EN_HK. UTF-8 "
are supported and installed on your system.
Perl:warning:Falling back to a fallback locale ("EN_HK. UTF-8 ").
SELECT * from Test;
Inside Store man's field unexpectedly is
<E6><9D><8E> ...
.
View default characters for client_encodeing
Show client_encoding;
Client_encoding
-----------------
sql_ascii
#设置为UTF8
\encoding UTF8
It's not over, it's embarrassing.
The internet search is actually a problem with the local character set:
$locale
locale:cannot set Lc_ctype to default locale:no such file or directory
Locale:cannot set Lc_messages to Default locale:no such file or directory
locale:cannot set Lc_all to default locale:no such file or directory
Lang=zh_cn. UTF8
language=en_hk:en
lc_ctype= "ZH_CN. UTF8 "
lc_numeric=zh_cn. UTF-8
LC_TIME=ZH_CN. UTF-8
lc_collate= "ZH_CN. UTF8 "
lc_monetary=zh_cn. UTF-8
lc_messages= "ZH_CN. UTF8 "
lc_paper=zh_cn. UTF-8
LC_NAME=ZH_CN. UTF-8
LC_ADDRESS=ZH_CN. UTF-8
LC_TELEPHONE=ZH_CN. UTF-8
LC_MEASUREMENT=ZH_CN. UTF-8
LC_IDENTIFICATION=ZH_CN. UTF-8
lc_all=
To achieve the purpose of the normal display of Chinese characters in your application, the following three variables should be as follows:
Lang=zh_cn. UTF-8
language=zh_cn:zh:en_us:en
lc_all=lc_all=zh_cn. UTF-8
Support Chinese Simplified execution:
sudo apt-get-y install Language-pack-zh-hans
Support Chinese Traditional execution:
sudo apt-get-y install language-pack-zh-hant
Then go to psql. Linked database execution SQL can be directly displayed in Chinese, and there is no following
The warning:
$psql _db
psql (9.6.4)
Type ' help ' for help.