diff --git a/CHANGES.txt b/CHANGES.txt index c0fd4f6942..82af7fc602 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,7 @@ * Disable reloading of GossipingPropertyFileSnitch (CASSANDRA-9474) * Verify tables in pseudo-system keyspaces at startup (CASSANDRA-10761) Merged from 2.1: + * 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) diff --git a/bin/cqlsh.py b/bin/cqlsh.py index 427fc29c08..8469836482 100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@ -738,6 +738,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) @@ -1035,7 +1037,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()