中文字符无法在unix中识别的问题:
1,
$file xxx.csv
xxx.csv: UTF-8 Unicode text, with very long lines
确认是不是UTF-8
2,
其次看是否有非法字符:
iconv -f utf-8 -t utf-16 XXXX.csv
Import csv data through extremeDB got following error:
[root@localhost bin]# ./xsql -c server65_0.cfg -i -locale zh_CN.utf8
XSQL>createtable ls_cp(gxsj date NULL,jgsj date NULL,dmdm char(15) NULL,cdbh int(1)NULL,hphm unicode using trigram index, hpys char(2) NULL,clsd char(3) NULL,csint(2) NULL, tpid char(34) NULL);
XSQL>insertinto ls_cp select * from foreign table(path='./ls_cp.csv',delimiter=',',skip=1)as ls_cp;
ERROR: Runtime error: Exceptionduring INSERT from SELECT for column ??? at record 0: ./ls_cp.csv:2:4: error inCSV file: Invalid argument: Invalid multibyte string
Ithappened before, it seems you use the -locale zh_CN.utf8 to solve, but theerror appear again. Anything wrong with the command line or the csv file?
firstly check -locale zh_CN.utf8 is included in the command line, and then confirm the format and encoding of the csv file.