UTF-8/Unicode Issues
Ouch -- could you paste the actual exception?
 I've since worked around it by doing:

d.name = unicode(name, 'utf-8')  

In my code. I'm guessing there's a little more to this, but will try to check again later on.

On 12/10/2012, at 16:59, Charles Leifer notifications@github.com wrote:

> Ouch -- could you paste the actual exception?
> 
> —
> Reply to this email directly or view it on GitHub.
 I have been putting off learning about encoding for so long, i'm not gonna change today...but maybe you might understand a bit better.  Do you know what might be different between your example and this test case?

https://github.com/coleifer/peewee/blob/master/tests.py#L918
 The tests are using a unicode string literal.  If you pass in an encoding to the unicode builtin, e.g. `unicode(..., 'utf-8')` then it will try to decode the value passed in.  If this value is an 8-bit string its fine, but if you pass in unicode you get `TypeError: decoding Unicode is not supported`.
 Well, I'm passing in a POST value after cleaning up from bottle.py. I suppose it's not really unicode, but haven't had time to figure out the differences yet.

There seem to be some UTF-8 issues lingering with Python 2.7.

While trying to set a text field to "Operações", I got the following stack dump:

Traceback (most recent call last):
...
  File "/home/rcarmo/test/devices.py", line 81, in activate_device
    d.save()
  File "/home/rcarmo/test/peewee.py", line 1992, in save
    update.execute()
  File "/home/rcarmo/test/peewee.py", line 1397, in execute
    result = self.database.execute(self)
  File "/home/rcarmo/test/peewee.py", line 1505, in execute
    sql, params = query.sql(self.get_compiler())
  File "/home/rcarmo/test/peewee.py", line 1394, in sql
    return compiler.parse_update_query(self)
  File "/home/rcarmo/test/peewee.py", line 837, in parse_update_query
    sets, params = self._parse_field_dictionary(query._update)
  File "/home/rcarmo/test/peewee.py", line 828, in _parse_field_dictionary
    val_params = [field.db_value(vp) for vp in val_params]
  File "/home/rcarmo/test/peewee.py", line 321, in db_value
    return value if value is None else self.coerce(value)
  File "/home/rcarmo/test/peewee.py", line 387, in coerce
    value = unicode(value or '')
