From be9fa05d06063ed84dca8f9ce6d3be5439359231 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Tue, 15 May 2012 17:19:04 -0500 Subject: [PATCH] Enable piping to cqlsh with locale.getpreferredencoding() Patch by paul cannon, reviewd by brandonwilliams for CASSANDRA-4113 --- bin/cqlsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cqlsh b/bin/cqlsh index 7a9d0a3ffb..d3d4eb4e73 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -45,6 +45,7 @@ import time import optparse import ConfigParser import codecs +import locale import re # cqlsh should run correctly when run out of a Cassandra source tree, @@ -408,7 +409,7 @@ class Shell(cmd.Cmd): self.color = color if encoding is None: - encoding = sys.stdout.encoding + encoding = locale.getpreferredencoding() self.encoding = encoding self.output_codec = codecs.lookup(encoding)