Commit 5450e1a7 authored by admuc's avatar admuc

minor bugfix

parent 4601a0e6
......@@ -1587,11 +1587,14 @@ def time_str(t):
else:
result = s + ' ' + time.tzname[0]
# Attempt to convert the localtime to the output encoding.
try:
result = bytes(result, 'utf8')
result = result.decode(getdefaultlocale()[1])
except Exception:
pass # ... hoping that it will go anywhere
# but only if OS != Windows, see
# https://asciidoc3.org/blog/minor-bug-already-fixed-asciidoc3-303.html
if not sys.platform.lower().startswith('win'):
try:
result = bytes(result, 'utf8')
result = result.decode(getdefaultlocale()[1])
except Exception:
pass # ... hoping that it will go anywhere
return result
def date_str(t):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment