Closed alfonsodg closed 10 years ago
From massimod...@gmail.com on April 27, 2009 21:24:30
we do not have a choice. Some database backends do not understand unicode so we encode as UTF thus the length we validate against is not the actual number of unicode characters but the number of UTF8 characters.
Status: WontFix
From attila.c...@gmail.com on March 26, 2009 07:19:58
In [1]: validator = IS_LENGTH(1)
In [2]: validator('a') Out[2]: ('a', None)
In [3]: validator('aa') Out[3]: ('aa', 'too long!')
In [4]: validator('á') Out[4]: ('\xc3\xa1', 'too long!')
In [5]: validator('á'.decode('utf-8')) Out[5]: (u'\xe1', None)
In [6]: validator('ж'.decode('utf-8')) Out[6]: (u'\u0436', None)
Original issue: http://code.google.com/p/web2py/issues/detail?id=35