-------- Original Message --------
> Subject: Re: [Rest2web-develop] Is there any short-term solution
> available?
> Date: Sun, 10 Sep 2006 08:53:04 -0300
> From: Marcelo G Huerta <mar...@gm...>
> Reply-To: Marcelo G Huerta <mar...@gm...>
> Organization: KilroySoft
> To: Michael Foord <fuz...@vo...>
>
>
>
> El 03/09/2006 a las 20:26, Michael Foord <fuz...@vo...>
> dijo, en su mensaje "[Rest2web-develop] Is there any short-term
> solution available?":
>
>> In the version of rest2web in subversion I have defined a very basic
>> macro - lt.
>
> The problem, as it results, is a different one. It refers to the
> encoding of uservalues. I have written my source file in what passes
> as latin-1, and I've specified that in the source file.
>
> For example, one of them starts like this:
>
> restindex
> crumb: 29.07.2005
> encoding: latin-1
> output-encoding: latin-1
> template: articulo_tpl.txt
> template-encoding: latin-1
> /restindex
>
> uservalues
> autor: Marcelo Huerta San Martín
> /uservalues
>
> (note the "í" in the uservalue "autor")
>
> Running rest2web, when it reaches this article it croaks with:
Sorry for the long delay in replying. It looks like uservalues are not
converted to unicode when they are parsed.
So non-ascii characters blow up when I encode them to the final encoding.
If you are using the version from subversion (recommended) then I think
the line to fix is line 1327 :
Change it from :
uservalues = enc_uni_dict(page['uservalues'], final_encoding)
to :
uservalues = page['uservalues']
This works in a simple test case, but I need to check that it is always
the right solution.
Thanks for the bug report.
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
>
> [other "Building..." messages snipped]
> Building randi20050729.html
> [err] Traceback (most recent call last):
> [err] File "D:\Editores\rest2web\r2w.py", line 187, in ?
> [err] count = main(options, config)
> [err] File "D:\Editores\rest2web\r2w.py", line 103, in main
> [err] return processor.walk()
> [err] File "D:\Editores\rest2web\rest2web\restprocessor.py", line
> 387, in walk
> [err] self.buildsection()
> [err] File "D:\Editores\rest2web\rest2web\restprocessor.py", line
> 1327, in buildsection
> [err] uservalues = enc_uni_dict(page['uservalues'], final_encoding)
> [err] File "D:\Editores\rest2web\rest2web\restutils.py", line 227,
> in enc_uni_dict
> [err] val = uni_dict[entry].encode(encoding)
> [err] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
> position 23: ordinal not in range(128)
> [err]
>
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.5/451 - Release Date: 19/09/2006
|