New submission from Petr Prikryl :
When ElementTree object is to be written to the file, and when BOM is needed,
the 'utf-8-sig' can be used for the purpose. However, the XML prolog then looks
like...
... and that encoding in the prolog makes no sense. Therefore,
the
Petr Prikryl added the comment:
@eryksun: Thanks for your help. I have finaly ended with your...
"Call setlocale(LC_CTYPE, ''), and then call time.strftime('%Z') to get the
timezone name."
--
___
Python tracker
<
Petr Prikryl added the comment:
@eryksun: I see. In my case, I can set the locale before importing the time
module. However, the code (asciidoc3.py) will be used as a module, and I cannot
know if the user imported the time module or not.
Instead of your suggestion
result = result.encode
Petr Prikryl added the comment:
I have worked around a bit differently -- the snippet from the code:
result = time.tzname[0]# simplified version of the original code.
# Because of the bug in Windows libraries, Python 3.3 tried to work around
# some issues. However, the shit hit
Petr Prikryl added the comment:
I have just observed behaviour for the Czech locale. I tried to avoid
collisions with stdout encoding, writing the strings into a file using UTF-8
encoding:
tzname_bug.py
--
#!python3
import time
import sys
with
Petr Prikryl added the comment:
Well, it is quite an old event. Anyway, I have fixed the simple example, and
launched it on Python 2.6, 2.7, 3.2, 3.3. It does not fail now. But I did not
tested it heavily.
>From my point of view, it was probably fi