aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2012-02-13 19:49:53 +0100
committerMatěj Cepl <mcepl@redhat.com>2012-02-13 19:58:30 +0100
commite98e114acc3634bee80021242be5e13d97a683c4 (patch)
tree93e576562369fc2d89e18304e319fc9b52605a17
parent874630611034b4cd5f40364c02910c4c4055391b (diff)
downloadjson_diff-e98e114acc3634bee80021242be5e13d97a683c4.tar.gz
Just get rid off locale.getpreferredencoding.
It doesn't do us any good and people should use UTF-8 anyway. Signed-off-by: Matěj Cepl <mcepl@redhat.com>
-rw-r--r--NEWS.txt3
-rwxr-xr-xjson_diff.py6
2 files changed, 5 insertions, 4 deletions
diff --git a/NEWS.txt b/NEWS.txt
index 6742cc9..fabacd3 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,3 +1,6 @@
+1.2.8 2012-02-13
+ * Give up on non-UTF-8 encoding for output.
+
1.2.7 2012-01-18
* Yet another (hopefully the last) fix of the development website. We are on fedorahosted.org now.
diff --git a/json_diff.py b/json_diff.py
index b77cf3c..0866eba 100755
--- a/json_diff.py
+++ b/json_diff.py
@@ -32,9 +32,7 @@ import logging
from optparse import OptionParser
__author__ = "Matěj Cepl"
-__version__ = "1.2.7"
-
-import locale
+__version__ = "1.2.8"
logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s',
level=logging.INFO)
@@ -358,7 +356,7 @@ def main(sys_args):
print(unicode(HTMLFormatter(diff_res)).encode("utf-8"))
else:
outs = json.dumps(diff_res, indent=4, ensure_ascii=False)
- print(outs.encode(locale.getpreferredencoding(do_setlocale=False)))
+ print(outs.encode("utf-8"))
if len(diff_res) > 0:
return 1