You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sn...@apache.org on 2015/12/27 17:29:06 UTC

cassandra git commit: cqlsh fails to decode utf-8 characters for text typed columns

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 3ccffc94b -> f1b9e9a65


cqlsh fails to decode utf-8 characters for text typed columns

patch by Yasuharu Goto; reviewed by Paulo Motta for CASSANDRA-10875


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f1b9e9a6
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f1b9e9a6
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f1b9e9a6

Branch: refs/heads/cassandra-2.1
Commit: f1b9e9a65a77842ee6c651bd9dc1176e2e6d395e
Parents: 3ccffc9
Author: Yasuharu Goto <ma...@gmail.com>
Authored: Sun Dec 27 17:26:22 2015 +0100
Committer: Robert Stupp <sn...@snazy.de>
Committed: Sun Dec 27 17:26:22 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 bin/cqlsh   | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1b9e9a6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 82176c5..41bf6bc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.13
+ * cqlsh fails to decode utf-8 characters for text typed columns (CASSANDRA-10875)
  * Log error when stream session fails (CASSANDRA-9294)
  * Fix bugs in commit log archiving startup behavior (CASSANDRA-10593)
  * (cqlsh) further optimise COPY FROM (CASSANDRA-9302)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1b9e9a6/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 651420d..1d5db25 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -668,6 +668,8 @@ class Shell(cmd.Cmd):
         self.session.max_trace_wait = max_trace_wait
         if encoding is None:
             encoding = locale.getpreferredencoding()
+            if encoding is None:
+                encoding = 'utf-8'
         self.encoding = encoding
         self.output_codec = codecs.lookup(encoding)
 
@@ -929,7 +931,7 @@ class Shell(cmd.Cmd):
 
     def get_input_line(self, prompt=''):
         if self.tty:
-            self.lastcmd = raw_input(prompt)
+            self.lastcmd = raw_input(prompt).decode(self.encoding)
             line = self.lastcmd + '\n'
         else:
             self.lastcmd = self.stdin.readline()