aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinterfaces/email/interactive/be-handle-mail2
-rw-r--r--libbe/command/html.py2
-rw-r--r--libbe/storage/util/config.py4
-rw-r--r--libbe/storage/vcs/base.py4
-rw-r--r--libbe/ui/util/editor.py2
-rw-r--r--libbe/util/encoding.py6
6 files changed, 10 insertions, 10 deletions
diff --git a/interfaces/email/interactive/be-handle-mail b/interfaces/email/interactive/be-handle-mail
index e20934a..1a48ead 100755
--- a/interfaces/email/interactive/be-handle-mail
+++ b/interfaces/email/interactive/be-handle-mail
@@ -721,7 +721,7 @@ def open_logfile(logpath=None):
LOGPATH = os.path.join(_THIS_DIR, logpath)
if LOGFILE == None and LOGPATH != u'none':
LOGFILE = codecs.open(LOGPATH, u'a+',
- libbe.util.encoding.get_filesystem_encoding())
+ libbe.util.encoding.get_text_file_encoding())
def close_logfile():
if LOGFILE != None and LOGPATH not in [u'stderr', u'none']:
diff --git a/libbe/command/html.py b/libbe/command/html.py
index 7420ce8..a6bd2a2 100644
--- a/libbe/command/html.py
+++ b/libbe/command/html.py
@@ -149,7 +149,7 @@ class HTMLGen (object):
if encoding != None:
self.encoding = encoding
else:
- self.encoding = libbe.util.encoding.get_filesystem_encoding()
+ self.encoding = libbe.util.encoding.get_text_file_encoding()
self._load_templates(template_dir)
self.min_id_length = min_id_length
diff --git a/libbe/storage/util/config.py b/libbe/storage/util/config.py
index 714d4e7..d138bf4 100644
--- a/libbe/storage/util/config.py
+++ b/libbe/storage/util/config.py
@@ -31,10 +31,10 @@ if libbe.TESTING == True:
import doctest
-default_encoding = libbe.util.encoding.get_filesystem_encoding()
+default_encoding = libbe.util.encoding.get_text_file_encoding()
"""Default filesystem encoding.
-Initialized with :func:`libbe.util.encoding.get_filesystem_encoding`.
+Initialized with :func:`libbe.util.encoding.get_text_file_encoding`.
"""
def path():
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py
index 22874a5..eaaf2d8 100644
--- a/libbe/storage/vcs/base.py
+++ b/libbe/storage/vcs/base.py
@@ -199,7 +199,7 @@ class CachedPathID (object):
>>> dir.cleanup()
"""
def __init__(self, encoding=None):
- self.encoding = libbe.util.encoding.get_filesystem_encoding()
+ self.encoding = libbe.util.encoding.get_text_file_encoding()
self._spacer_dirs = ['.be', 'bugs', 'comments']
def root(self, path):
@@ -350,7 +350,7 @@ class VCS (libbe.storage.base.VersionedStorage):
def __init__(self, *args, **kwargs):
if 'encoding' not in kwargs:
- kwargs['encoding'] = libbe.util.encoding.get_filesystem_encoding()
+ kwargs['encoding'] = libbe.util.encoding.get_text_file_encoding()
libbe.storage.base.VersionedStorage.__init__(self, *args, **kwargs)
self.versioned = False
self.interspersed_vcs_files = False
diff --git a/libbe/ui/util/editor.py b/libbe/ui/util/editor.py
index 206e9c4..fb51159 100644
--- a/libbe/ui/util/editor.py
+++ b/libbe/ui/util/editor.py
@@ -65,7 +65,7 @@ def editor_string(comment=None, encoding=None):
>>> del os.environ["VISUAL"]
"""
if encoding == None:
- encoding = libbe.util.encoding.get_filesystem_encoding()
+ encoding = libbe.util.encoding.get_text_file_encoding()
editor = None
for name in ('VISUAL', 'EDITOR'):
if name in os.environ and os.environ[name] != '':
diff --git a/libbe/util/encoding.py b/libbe/util/encoding.py
index 8663744..949b3ce 100644
--- a/libbe/util/encoding.py
+++ b/libbe/util/encoding.py
@@ -54,7 +54,7 @@ def get_output_encoding():
def get_text_file_encoding():
"""Return the encoding that should be used for file contents
"""
- return 'utf-8'
+ return get_encoding()
def get_argv_encoding():
return get_encoding()
@@ -75,7 +75,7 @@ def known_encoding(encoding):
def get_file_contents(path, mode='r', encoding=None, decode=False):
if decode == True:
if encoding == None:
- encoding = get_filesystem_encoding()
+ encoding = get_text_file_encoding()
f = codecs.open(path, mode, encoding)
else:
f = open(path, mode)
@@ -86,7 +86,7 @@ def get_file_contents(path, mode='r', encoding=None, decode=False):
def set_file_contents(path, contents, mode='w', encoding=None):
if type(contents) == types.UnicodeType:
if encoding == None:
- encoding = get_filesystem_encoding()
+ encoding = get_text_file_encoding()
f = codecs.open(path, mode, encoding)
else:
f = open(path, mode)