How to change encoding in cbimport?

[env]
couchbase 7.0 beta

hello.

$ cbimport csv -c couchbase://127.0.0.1 -u Administrator -p password -b test -d file://C:/Users/Desktop/test.csv -g key::asdf -t 2

I put the csv file as a document through cbimport.


However, due to the Encoding problem, the Korean alphabet was broken as follows.

I want to change the encoding to UTF-8. Don’t you apply yet?

how to change encoding in cbimport?

Thank you.

Hello @leech ,

That feels like a bug. I’m wondering if it’s the UI or cbimport as you pointed out. Would it be possible to share the file or the Korean characters, so I can reproduce this issue.

Cheers,
Patrick

Hello, @pvarley .

Thank you for trying to help,

I am attaching the csv file that I used.

test.zip (277 Bytes)

In addition, when I tried to insert the document’s ID in Korean, an error occurred as follows.

i used this command.

cbimport csv -c couchbase://127.0.0.1 -u Administrator -p password -b test -d file://C:/Users/leech/Desktop/test.csv -g key::asdf -t 2

Is it a bug, not an encoding problem?

I’ll be waiting for your help.

Thank you.

Hello @leech ,

The test.csv file provided is using “ISO-8859” and as such does not support the Korean characters:

$ file test.csv 
test.csv: ISO-8859 text, with CRLF line terminators

When the file is open using less it’s reported as having binary data:

 $ less test.csv 
"test.csv" may be a binary file.  See it anyway? 

Once opened in less the data is not printed correctly:

id,gender,weight,<B3><AA><C0><CC>,name
1,f,12,11,<C0><CC>â<C7><F5>
2,f,55,22,<B3>ʱ<B8><B8><AE>
3,m,66,33,<BC><EE><B8><DE>
4,m,777,44,<C0>ӿ<B5>
5,f,888,55,<BF><B5>Ź
6,m,99,66,<C0>̹<CC>

The CSV is not using the correct encoding. Can it be recreate using UTF-8 encoding?


I have tested the following file which is encoded UTF-8 with Korean characters:

name,age
이름이 뭐예요,60
$ file test-2.csv 
test-2.csv: UTF-8 Unicode text

This is how the UI looks:

I hope this helps.

1 Like

Hello @pvarley .

The problem was the encoding of the csv file. Thank you.

my mistake.

Thank you for your kind help.

Have a good day.