PostGis is in utf8.

I've tried to force the utf8 codification like that:
    description = title + ' ' + event.description.encode("utf-8")

Same error.

Il giorno venerdì 6 gennaio 2017 17:27:17 UTC+1, Gael Princivalle ha 
scritto:
>
> Hello.
>
> I'm made a new application in a new web2py installation 2.14.6. The db is 
> PostGis.
> It's a mountain bike meeting platform.
> There's only one user for the moment, myself ☺.
>
> Here is an event:
> https://www.mtbconnection.com/en/mtb_ride?event_id=1
>
> You can see that the event description is:
> Per chi si vuole unire. Andrò a fare un giretto per le scale del 
> Valentino, e poi qualche su e giu nel parco Leopardi, lavorando su aspetti 
> tecnici.
>
> When I display it in the mtb_ride page no problem:
> {{=DIV(event.description, _class='trail_description', _id=
> 'trail_description')}}
>
> If I try in the controller to concatenate event.description with 
> event.title:
> description = title + ' ' + event.description
>
> I've a ticket, due to the 'ò'. Here is the traceback:
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
>
> Traceback (most recent call last):
>   File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/restricted.py", line 
> 227, in restricted
>     exec ccode in environment
>   File 
> "/home/tasko/webapps/w2p_2_14_16/web2py/applications/mtbconnection/controllers/default.py"
>  <https://prod2.tasko.it/admin/edit/mtbconnection/controllers/default.py>, 
> line 392, in <module>
>   File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/globals.py", line 417, 
> in <lambda>
>     self._caller = lambda f: f()
>   File 
> "/home/tasko/webapps/w2p_2_14_16/web2py/applications/mtbconnection/controllers/default.py"
>  <https://prod2.tasko.it/admin/edit/mtbconnection/controllers/default.py>, 
> line 249, in mtb_ride
>     description = title + ' ' + event.description
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 28: 
> ordinal not in range(128)
>
>
> I've seen that someone have got a similar problem and resolved it 
> installing psycopg2.
> I've installed it:
> pip install psycopg2
> I've restarted the server.
>
> Problem still the same.
>
> Can someone give me a hand?
>
> Thanks, regards.
>
>
>
>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to