On Thu, Nov 08, 2007 at 01:20:22PM -0500, David Turner wrote:
> On Thu, 2007-11-08 at 21:08 +0300, Oleg Broytmann wrote:
> > > 333 for UnicodeCol (1000 bytes / 3 bytes * char)
> > Why 3 bytes?!
> SQLObject converts Unicode to UTF-8 before sending it to MySQL. So
> length should be 1000 regardless, until we fix the mysql bindings.
UTF-8 doesn't allocate 3 bytes for a character. ASCII chars use 1 byte,
some chars use 2 bytes, some 4 bytes. "3 bytes for a character" is a rough
guess, and if we go that way we should have a way for the user to adjust
the quotient. "length", in my opinion, is good enough for this - the user
just have to understand that it is the byte length, not characters.
Oleg Broytmann http://phd.pp.ru/ phd@...
Programmers don't die, they just GOSUB without RETURN.