Re: Fwd: Timestamp convertor plugin



>
> Hi,
> thank you for your interest. Now I fixed most of this issue but I have some questions. First about configuration - it's
> easy to determine date/time format from current locale, so I can remove settings and take date/time format from the
> locale. But I don't how much is this good - how many users has configured wrong locale... What do you think? And the
> second - I don't understand about locale encoding. I look at kupferstring and if I am not wrong it's for conversion
> strings between locale encoding and utf-8 for internal use. So, the danger is in input from user (date string or
> timestamp)? Or I am wrong? Can you explain it to me, please? After solving this two darkness I try to commit this plugin
> into git hub :)

It looks like Karol has adopted your timestamp plugin:

http://github.com/KarolBedkowski/kupfer-adds/commit/6cfd758d0ef5939f41c014bd78c95f0935ac6b12

Where it seems the international text issues are addressed correctly.
The fact is simply that the time formatting functions return a
locale-specific string with a byte string (Python type `str') encoded
with the locale's encoding. It's no mystery if Python programmers get
this wrong though, because this is horribly underdocumented
(Documentation has no single mention of encoding, which is nothing
short of scandalous -- http://docs.python.org/library/time.html ). We
do not as you suggest convert to utf-8 or so. The internal format for
strings in Kupfer is the Python `unicode' type which is an
"encoding-agnostic" type.

Ulrik


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]