>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, Jan 4, 2016 at 11:59 AM, Yebach <vid.og...@gmail.com> wrote:

> 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.decode('utf8')
>>
>> Or
>>
>> javascritp_string_var = unicode(s, 'utf8')
>>
>> Richard
>>
>>
>> On Mon, Jan 4, 2016 at 11:34 AM, Yebach <vid....@gmail.com> wrote:
>>
>>> Hello
>>>
>>> I have the following scenario.
>>>
>>> Database is PostgreSQL, encoding set to UTF-8
>>>
>>> When I read data from database with web2py I get a string reading in
>>> type of *Bolni\xc4\x8dar* where it was suppose to be *Bolničar*.
>>>
>>> Now, when i use web2py to present data in my view is all fine (so I can
>>> see *Bolničar*), but when i use Java Script or anything else to present
>>> data I get weird behavior, where ščžć is not presented.
>>> I would like that  my reading from db would be Bolničar from beginning
>>> so I have no more hassle later.
>>>
>>> also the data in my database is *Bolničar*.
>>>
>>> I do all the db inserts with web2py and they are all ok. Looks like only
>>> reading is kind of "wrong"
>>>
>>> Any suggestions?
>>> Thank you
>>>
>>> --
>>> 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+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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.
>

-- 
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