removing hex coder - DB should never not be UTF8, and the code is not used anywhere else. this also caused failure on mac OSX
This commit is contained in:
parent
d44d1dda3e
commit
63f3bbb15f
|
@ -26,9 +26,7 @@ import Configuration
|
||||||
|
|
||||||
encoder_to_utf = codecs.lookup('utf-8')
|
encoder_to_utf = codecs.lookup('utf-8')
|
||||||
encoder_to_sys = codecs.lookup(Configuration.LOCALE_ENCODING)
|
encoder_to_sys = codecs.lookup(Configuration.LOCALE_ENCODING)
|
||||||
coder_hex = codecs.lookup('hex_codec')
|
|
||||||
|
|
||||||
hex_coding = False #FIXME: Should only be on if db is not UTF8 - test in Database.py?
|
|
||||||
# I'm saving a few cycles with this one
|
# I'm saving a few cycles with this one
|
||||||
not_needed1, not_needed2, not_needed3 = False, False, False
|
not_needed1, not_needed2, not_needed3 = False, False, False
|
||||||
if Configuration.LOCALE_ENCODING == 'UTF8':
|
if Configuration.LOCALE_ENCODING == 'UTF8':
|
||||||
|
@ -77,19 +75,3 @@ def to_gui(s):
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
sys.stderr.write(_('Could not encode: "%s"\n') % s)
|
sys.stderr.write(_('Could not encode: "%s"\n') % s)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def to_hex(s):
|
|
||||||
try:
|
|
||||||
out = coder_hex.encode(s)[0]
|
|
||||||
return out
|
|
||||||
except UnicodeDecodeError:
|
|
||||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
|
||||||
return s
|
|
||||||
|
|
||||||
def from_hex(s):
|
|
||||||
try:
|
|
||||||
out = coder_hex.decode(s)[0]
|
|
||||||
return out
|
|
||||||
except UnicodeDecodeError:
|
|
||||||
sys.stderr.write(_('Could not convert: "%s"\n') % s)
|
|
||||||
return s
|
|
||||||
|
|
|
@ -315,8 +315,6 @@ class Site:
|
||||||
self.layout = {}
|
self.layout = {}
|
||||||
self.emails = {}
|
self.emails = {}
|
||||||
|
|
||||||
#print _("Loading site"), self.site_name
|
|
||||||
|
|
||||||
for layout_node in node.getElementsByTagName('layout'):
|
for layout_node in node.getElementsByTagName('layout'):
|
||||||
lo = Layout(layout_node)
|
lo = Layout(layout_node)
|
||||||
self.layout[lo.max] = lo
|
self.layout[lo.max] = lo
|
||||||
|
|
Loading…
Reference in New Issue
Block a user