[web2py] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-05-15 Thread Annet
After upgrading to web2py version 2.10.3 I get an error on fields
of type text when they contain accented latin characters, see
traceback.


Traceback (most recent call last):
  File "/Users/iannet/web2py_local/gluon/restricted.py", line 227, in 
restricted
exec ccode in environment
  File 
"/Users/iannet/web2py_local/applications/my/controllers/landingpage.py", 
line 131, in 
  File "/Users/iannet/web2py_local/gluon/globals.py", line 393, in 
self._caller = lambda f: f()
  File "/Users/iannet/web2py_local/gluon/tools.py", line 3440, in f
return action(*a, **b)
  File "/Users/iannet/web2py_local/gluon/tools.py", line 3440, in f
return action(*a, **b)
  File 
"/Users/iannet/web2py_local/applications/my/controllers/landingpage.py", 
line 116, in landingpage_form
if form.process().accepted:
  File "/Users/iannet/web2py_local/gluon/html.py", line 2301, in process
self.validate(**kwargs)
  File "/Users/iannet/web2py_local/gluon/html.py", line 2238, in validate
if self.accepts(**kwargs):
  File "/Users/iannet/web2py_local/gluon/sqlhtml.py", line 1677, in accepts
self.id_field_name]).update(**fields)
  File "/Users/iannet/web2py_local/gluon/packages/dal/pydal/objects.py", 
line 2117, in update
ret = db._adapter.update("%s" % table._tablename,self.query,fields)
  File 
"/Users/iannet/web2py_local/gluon/packages/dal/pydal/adapters/base.py", 
line 988, in update
raise e
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: 
ordinal not in range(128)


Why isn't my application backward compatible?

Kind regards,

Annet

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


[web2py] "UnicodeDecodeError: 'ascii' codec can't decode byte ...

2010-11-08 Thread Omri
Hello,

I'm having a unicode problem with the DAL.

I'm developing a (mainly) RPC database application with qooxdoo as JS
framework and web2py as the webserver.

I have created a fairly generic update_record function which simply
gets two input variables - a table name and a data dictionary with
name/value pairs which correspond to the fields of the table.
My function looks like this:

def update_record(table_name, data):
db(db[table_name]['id'] == data['id']).update(**data)
return db(db[table_name]['id'] == data['id']).select()

My application should work both in English and in German, and my
problem is that when I try to update a string value with an Umlaut
(example - "Ɯberwlad") I get an error:
"UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position..."

I am able to insert records to the database with Umlauts, but I use a
different method for the insert. I use the syntax of .insert(name =
value, name2 = value2,...).

I tried to encode all the data keys which are unicode objects without
success, it keeps raising the same error.

Am I missing something here, or is this a bug? And more interestingly,
how can it be solved?

Thanks,
Omri