2
私はcqlshにエンコードの問題があります。CQLSHの特殊文字の問題
私はCQLSHコマンドを使用して特殊文字を含むテキストデータを挿入しよう:
cqlsh localhost -k my_keyspace -f /home/me/workspace/scripts/test.cql
(次の行を含むtest.cql):
INSERT INTO table_content (tableId, title, content) VALUES ('record1', 'Mon titre', 'Mon contenu avec un accent évidemment');
私は次のエラーを取得する:
Traceback (most recent call last):
File "/opt/applications/apache-cassandra-2.1.8/bin/cqlsh", line 2459, in <module>
main(*read_options(sys.argv[1:], os.environ))
File "/opt/applications/apache-cassandra-2.1.8/bin/cqlsh", line 2451, in main
shell.cmdloop()
File "/opt/applications/apache-cassandra-2.1.8/bin/cqlsh", line 940, in cmdloop
line = self.get_input_line(self.prompt)
File "/opt/applications/apache-cassandra-2.1.8/bin/cqlsh", line 909, in get_input_line
self.lastcmd = self.stdin.readline()
File "/usr/lib/python2.7/codecs.py", line 672, in readline
return self.reader.readline(size)
File "/usr/lib/python2.7/codecs.py", line 527, in readline
data = self.read(readsize, firstline=True)
File "/usr/lib/python2.7/codecs.py", line 474, in read
newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 26: ordinal not in range(128)
私のファイルはUTF-8でエンコードされていますが、 cqlshコマンドラインでUTF-8エンコーディングを強制する方法はありますか?私は次のバージョンを使用します(そして、私は選択肢がありません):[cqlsh 5.0.1 |カサンドラ2.1.8 | CQL仕様3.2.0 |ネイティブプロトコルv3]
OK( 'UTF8'))、感謝をコードします。私はこれが私の問題を解決すると思うが、私はそのようなパッチを適用する許可を持っていない。とにかくありがとう。 – Mathyeux