[Zope-dev] fmt=structured-text doesn't work with accented chars
Leonardo Rochael Almeida
leo@hiper.com.br
Wed, 12 Sep 2001 20:50:41 -0300
AACK! How dumb can one get? The patch below is broken, here is the correct
one:
--- lib/python/StructuredText/STletters.py.orig Wed Sep 12 20:00:52 2001
+++ lib/python/StructuredText/STletters.py Wed Sep 12 20:47:36 2001
@@ -1,8 +1,7 @@
-import string
+
try:
- del string
import locale
- locale.setlocale(locale.LC_ALL,"")
+# locale.setlocale(locale.LC_ALL,"")
except:
pass
On Wed, Sep 12, 2001 at 08:36:24PM -0300, Leonardo Rochael Almeida wrote:
> Got it!
>
> StructuredText is setting locale back to C, during initialization, without setting it back to
> whatever it was before, in 'STletters.py'. I think it is wrong not only for
> this unilateral choice of locale :-), but also for trying to ignore python's
> notion of what the locale is when trying to calculate letters.
>
> The patch below fix both my 'Script (Python)' and the parsing problem with
> StructuredText. I took the liberty of removing the spurious 'import string'.
>
>
> --- lib/python/StructuredText/STletters.py.orig Wed Sep 12 20:00:52 2001
> +++ lib/python/StructuredText/STletters.py Wed Sep 12 20:23:24 2001
> @@ -1,8 +1,8 @@
> -import string
> +
> try:
> del string
> import locale
> - locale.setlocale(locale.LC_ALL,"")
> +# locale.setlocale(locale.LC_ALL,"")
> except:
> pass
>
>
> Is there anywhere else I should submit it?
>
> Cheers, Leo
>
> PS: BTW, I'm still trying to figure out how to correctly set the locale on
> Windows, if anyone knows... :-)