Re: [web2py] Encoding while reading postgres data

2016-01-20 Thread Richard Vézina
You need XML() web2py helper when you pass python string or generate js code from python you need it... In the view : {{=XML(python_var_containing_text_or_js_code}} Richard On Wed, Jan 20, 2016 at 4:52 AM, Yebach wrote: > In this case I get the list of string > > users = [u'Ga\u0161peri\u010d

Re: [web2py] Encoding while reading postgres data

2016-01-20 Thread Yebach
Solved the problem I posted on stackoverflow.com http://stackoverflow.com/questions/34596573/javascript-string-encoding-on-client vote up or correct if it is not ok On Wednesday, January 20, 2016 at 3:41:13 PM UTC+1, Richard wrote: > > You need XML() web2py helper when you pass python string o

Re: [web2py] Encoding while reading postgres data

2016-01-20 Thread Yebach
In this case I get the list of string users = [u'Ga\u0161peri\u010d', u'GovednikK', u'Jam\u0161ek', u'Jurejev\u010di\u010d', u'Kati\u0107', u'Kostelec', u'Ko\u0161ele', u'Male\u0161i\u010d', u'Muhi\u010d', u'Re\u017eek', u'Sitar', u'Toma\u017ei\u010d', u'Viktorovski', u'Vuk\u0161ini\u010dD',

Re: [web2py] Encoding while reading postgres data

2016-01-04 Thread Richard Vézina
>From js directly? I not really good with js but I guess there is encoding too... From web2py you can't since everything use byte (str('byte string')) and not unicode (u'your properly encoded string')... So if you pass data from web2py what I showed you is the way of doing it... Richard On Mon, J

Re: [web2py] Encoding while reading postgres data

2016-01-04 Thread Yebach
Ok, but I would like to already see the right endocing when I get data from server database? On Monday, January 4, 2016 at 5:39:32 PM UTC+1, Richard wrote: > > When passing data from python to javascript I guess you will need to use > unicode or decode > > try > > javascritp_string_var = s.dec

Re: [web2py] Encoding while reading postgres data

2016-01-04 Thread Richard Vézina
When passing data from python to javascript I guess you will need to use unicode or decode try javascritp_string_var = s.decode('utf8') Or javascritp_string_var = unicode(s, 'utf8') Richard On Mon, Jan 4, 2016 at 11:34 AM, Yebach wrote: > Hello > > I have the following scenario. > > Databa