Hi, Dmitry

You've got a unicode string. So you need to convert it to a str type
with utf-8 sequence in it. Use encode() method of unicode type:

>>> s = u'\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0440\u0435
\u0434\u0441\u0442\u0432 \u0441\u043e \u0441\u0447\u0435\u0442\u0430
\u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c'
>>> print s
Перенос средств со счета в очередь
>>> type(s)
<type 'unicode'>
>>> s.encode('utf-8')
'\xd0\x9f\xd0\xb5\xd1\x80\xd0\xb5\xd0\xbd\xd0\xbe\xd1\x81 \xd1\x81\xd1
\x80\xd0\xb5\xd0\xb4\xd1\x81\xd1\x82\xd0\xb2 \xd1\x81\xd0\xbe \xd1\x81
\xd1\x87\xd0\xb5\xd1\x82\xd0\xb0 \xd0\xb2 \xd0\xbe\xd1\x87\xd0\xb5\xd1
\x80\xd0\xb5\xd0\xb4\xd1\x8c'
>>> s1=s.encode('utf-8')
>>> type(s1)
<type 'str'>
>>> print s1
Перенос средств со счета в очередь

Now you can use s1 in your returrn clause.


Vlad
Chernivtsi, Ukraine

У сб, 2015-06-06 у 01:22 -0700, Dmitry Ermolaev пише:

> u'\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441\u0440\u0435\u0434
> \u0441\u0442\u0432 \u0441\u043e \u0441\u0447\u0435\u0442\u0430 \u0432
> \u043e\u0447\u0435\u0440\u0435\u0434\u044c'
> 
> 

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