From: W. Trevor King Date: Thu, 8 Sep 2011 20:10:02 +0000 (-0400) Subject: Add the BE_ENCODING environmental variable to override the default encoding. X-Git-Tag: 1.1.0~175^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=231dc0a3570f74f63b538544bdc805b71f5f6af0;p=be.git Add the BE_ENCODING environmental variable to override the default encoding. --- diff --git a/libbe/util/encoding.py b/libbe/util/encoding.py index 3fde8cb..77d62fc 100644 --- a/libbe/util/encoding.py +++ b/libbe/util/encoding.py @@ -23,6 +23,7 @@ Support input/output/filesystem encodings (e.g. UTF-8). import codecs import locale +import os import sys import types @@ -31,7 +32,8 @@ if libbe.TESTING == True: import doctest -ENCODING = None # override get_encoding() output by setting this +ENCODING = os.environ.get('BE_ENCODING', None) +"override get_encoding() output" def get_encoding(): """