Converting DD MM YYYY into YYYY-MM-DD?
nospam at nospam.com
Tue Aug 18 10:19:53 CEST 2009
On Tue, 18 Aug 2009 01:11:20 -0700, Rami Chowdhury
<rami.chowdhury at gmail.com> wrote:
>Could you let me know which platform this is on (Windows, *nix)? It may be a
>locale encoding issue -- the locale.setlocale() function allows the second
>argument to be a tuple of (locale_code, encoding), as below:
>locale.setlocale(locale.LC_ALL, ('FR', 'UTF-8'))
It's on XP, and I'm using ActivePython 184.108.40.206.
Python doesn't like the above:
#locale.Error: unsupported locale setting
locale.setlocale(locale.LC_ALL, ('FR', 'UTF-8'))
Maybe it was introduced in more recent versions of Python?
>Since this is for a one-shot (and presumably threading-agnostic) program, and
>a fairly trivially formatted date-string, I would suggest using
>not regular expressions (which IIRC have Issues with non-ASCII characters).
If the regex library can only handle basic latin characters, I'll wait
until a script I'm running is done, and I'll upgrade to the 220.127.116.11 to
see how it goes.
More information about the Python-list