Hi - 

I am working with some unicode lists that I am inserting into a postgres 
database. From the documentation I see that fields of type list:string are 
converted to | separated strings before being inserted into the db.

When attempting to insert a list of values that contains unicode 
charactyers:
'pl1_guest_list': [u'Ren\xe9e Marino', u'Renee Marino'],

I get the error:
'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in 
range(128)

This leads me to base.py, line 1337 where I see:
            if field_is_type('list:string'):
                obj = map(str,obj)

My initial thought is that "str" needs to be replaced with "unicode" but I 
am sure that there are additional repercussions if the database encoding is 
set to something other than unicode - and there is the 8 vs. 16 issues as 
well.

I am guessing that there is some ability to introspect the database to see 
what encoding has been declared but I have not been into the web2py source 
before and I know this is going to take me a long time to uncover. Anyone 
out there on the core team care to suggest a starting point - or maybe this 
is a simple fix?

Tom



-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to