Re: [Rest2web-develop] (pretty strange) encoding error with rest2web on a Mac
Brought to you by:
mjfoord
From: Ben <bi...@ma...> - 2008-11-25 17:46:39
|
On Tue, Nov 25, 2008 at 12:01 PM, Michael Foord <fuz...@vo...>wrote: > Hello Ben, Hi Michael, thanks a lot for your email and thanks a million times for rest2web! Sorry for the late reply. No problem at all. I was just wandering if my email ever reached the lidie! > > Interestingly the error is in an encode operation (not a decode) - so it > happens when rest2web is trying to write out a file rather than reading > one in (so I don't *think* it is to do with guessing encoding). OK, interesting and good to know! In fact I've discovered that as well by testing and testing all the files, they are in UTF-8 (a python guru friend of mine has created a little script to test file char by char :)) So the problem seems to be the output. > Can you put the following in the restindex of your main index file and > see if it helps: > > output-encoding: utf8 > Actually, I've tried everything I could, including the directive you mention. Here is what in my updated files: encoding: utf-8 output-encoding: utf-8 in all the files. It doesn't help. I've tried to remove the page-description (because it contained non ascii char). Btw a quick question: the error message is a bit obscure, do you think there is a way to know exactly where it failed? The error message says something like: [err] UnicodeError: Unable to decode input data. Tried the following encodings: 'utf-8'. [err] (UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1689-1690: invalid data) It's not really clear. I would enjoy something like: "can't decode bytes in position 1689-1690: invalid data at "and Hello in Klingon is !@#@#$" But I've been investigating a bit deeper and now I'm completely puzzled: the thing which is really weird is I've copied, with `scp -r` the directory with my faulty website and the rest2web archive (with r2w.py in it) on a Linux box (debian stable). And I run the thing with my Makefile. Guess what? It *works*. Perfectly. Seamlessly. So the problem is probably not the files, and not rest2web. I'm wondering about Python, or HFS+ (?). I know it's weird, but ... I can't say anything else. So here are my python flavors: $ /usr/bin/python --version Python 2.5.1 and using the ports: $ /opt/local/bin/python2.5 --version Python 2.5.2 I've tried to use both by calling directly r2w.py (for the standard python) or /opt/local/bin/python-2.5 r2w.py (for the python-on-ports). I've installed docutils for the 2 separates systems. Both fail in compiling the website. Well, I don't know what to say. I've read your blog, Michael, and I think you have a Mac too. Have you ever get in these issues? Kind regards, -- Ben |