Monday, July 09, 2007

Gotcha: Unicode Error with SQLObject + Turbogears + mysql

I spent a bit of time this morning trying to figure out why the code I wrote at 3am last night wasn't working. I kept getting a crazy Unicode conversion not supported error, and all the solutions that I found Googling were not satisfactory. Eventually, I found that I had used the wrong validator on one of my fields (specifically, a Date field, though I imagine this will happen with others as well). If you run into this, double check your validators before you do anything crazy like change your model to use all UnicodeCols.

Also, on the subject of validators in Turbogears, I recommend using the FormEncode documentation directly, it's much more complete than what you find listed in Turbogears docs.

No comments: