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