2011/1/6 Branko Vukelić <[email protected]>:
> On Wed, Jan 5, 2011 at 6:57 PM, Sergei Sadovski <[email protected]> wrote:
>> -    if t is unicode:
>> +    if isinstance(obj,unicode):
>
> Hot damn! I completely forgot about this. I've seen it the other day,
> but didn't bother since I'm not using web.py these days.

Here's what bottle guys are using:

    def touni(x, enc='utf8'):
        """ Convert anything to unicode """
        return str(x, encoding=enc) if isinstance(x, bytes) else str(x)

Seems to work well.

-- 
Branko Vukelic

[email protected]
http://www.brankovukelic.com/

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to