Company leaders want me to lead a file to the Sybase IQ database in a table, the load table statement is as follows:
load table kyfx_ci_loc(
city_name ‘,‘,
county_id
ci_name ‘,‘,
ci_section ‘,‘,
ci_id ‘,‘,
ci_longtitude_gps ‘,‘,
ci_latitude_gps ‘,‘,
ci_longtitude_baidu ‘,‘,
ci_latitude_baidu 0x0a)
using file ‘/home/sybase/baidulocations.txt‘
quotes off
escapes off
go
After the guide from the client to see the discovery character set garbled, I began to see is not a file character encoding problem;
So I see the file modification file character encoding in VI
: Set Fileencoding=utf-8
Also use eNCA to convert file character encoding sets
Enca-l zh_cn File
Check the encoding of the file
Enca-l zh_cn-x UTF-8 File
Convert file encoding to "UTF-8" encoding
Enca-l zh_cn-x UTF-8 file1 file2
If you do not want to overwrite the original file
Then I look at the character encoding of the Sybase IQ server and the client
To view the database character set:
Select Db_property (' collation ')
Or
Select Db_property (' CharSet ')
To view the client character set:
Select Connection_property (' CharSet ')
learned that both the server and client character sets are Iso_1
I want to modify the client character set to cp936, so I look at the character encoding of the machine
Cat/etc/sysconfig/i18nlang= "en_US. UTF-8 "sysfont=" Latarcyrheb-sun16 "
So modify the/etc/sysconfig/i18n
Lang= "ZH_CN. UTF-8 "supported=" ZH_CN. GB2312:zh_CN:zh:en_US. Utf-8:en_us:en "
From this guide will not appear in Chinese display garbled!
Sybase IQ Database Load table character set garbled