On Dec 20, 2007, at 2:53 AM, Julien Cigar wrote:
> I use Pylons 0.9.6 with SQLAlchemy 0.4.1 and Genshi
0.4.4
>
> I have a strange unicode dilemma ... :
> - either I set sqlalchemy.convert_unicode = true in my
configuration
> file and url_for fails with : exceptions.Exception:
url_for can only
> return a string or None, got unicode instead:
/ias/pics/published.png
> - either I don't set sqlalchemy.convert_unicode and
then Genshi fails
> with : exceptions.UnicodeDecodeError: 'ascii' codec
can't decode byte
> 0xc3 in position 2: ordinal not in range(128)
>
> Any idea how could I resolve this (other than str()
everything in my
> template files ..) ?
Go with the first option, and can you provide more details
on how
you're calling url_for? Ensuring you're calling url_for
properly, and
keeping everything unicode where possible is the best
solution.
Cheers,
Ben |