Restructured Text and High ASCII
Thanks to Andreas' great work on the reStructured Text backport, I've been able to offer it up for experimentation as an alternative to structured text. But ... we've immediately run into encoding problems with text copied-and-pasted from Windows apps. The texts have high ascii (ord > 127) which might produce unexpected results in structured text, but didn't break anything. Rendering as reStructured Text produces the exception: Error type: UnicodeError Error value: ASCII encoding error: ordinal not in range(128) I'm woefully ignorant on alternative encodings. Anyone got a simple Python recipe I can use to wrap user-submitted text so that it won't bust docutils? Thanks! Steve -- ______________________________________________________ Steve McMahon Reid-McMahon, LLC steve@reidmcmahon.com steve@dcn.org
On Wednesday 30 April 2003 10:00 pm, Steve McMahon wrote:
Thanks to Andreas' great work on the reStructured Text backport, I've been able to offer it up for experimentation as an alternative to structured text. But ... we've immediately run into encoding problems with text copied-and-pasted from Windows apps. The texts have high ascii (ord > 127) which might produce unexpected results in structured text, but didn't break anything. Rendering as reStructured Text produces the exception:
Error type: UnicodeError Error value: ASCII encoding error: ordinal not in range(128)
I'm woefully ignorant on alternative encodings. Anyone got a simple Python recipe I can use to wrap user-submitted text so that it won't bust docutils?
Thanks! Steve
Add the following code to a sitecustomize.py module in your python's site-packages: import sys sys.setdefaultencoding('latin-1') hth, -Casey
Casey Duncan wrote:
Add the following code to a sitecustomize.py module in your python's site-packages:
import sys sys.setdefaultencoding('latin-1')
Wouldn't it give the same result to set the language parameter in Zope? ie: -L 'danish' Solves similar problems for me. regards Max M
--On Donnerstag, 1. Mai 2003 8:46 Uhr +0200 Max M <maxm@mxm.dk> wrote:
Casey Duncan wrote:
Add the following code to a sitecustomize.py module in your python's site-packages:
import sys sys.setdefaultencoding('latin-1')
Wouldn't it give the same result to set the language parameter in Zope? ie:
-L 'danish'
Wouldn't it give the same result to set the language parameter in Zope? ie: -L 'danish' No, reST does not care for good reasons about locales. -aj
participants (4)
-
Andreas Jung -
Casey Duncan -
Max M -
Steve McMahon