Note that a string has no single well-defined length in bytes -- it
depends on the encoding. This hypothetical validator would thus need
to take an encoding as a parameter, and you'll have to make sure it
matches your DB's encoding. Be careful! It's a sticky problem.
That said, it would be a useful thing to have in contrib if properly
written.
Cheers,
Paul
On Dec 16, 2005, at 1:26 AM, Chihpeng Lin wrote:
I am a newbie of Tapestry.
I looked up the API of StringValidator.
It says:
Simple validation of strings, to enforce required, and minimum
length (maximum length is enforced in the client browser, by
setting a maximum input length on the text field).
What if the string is a non single byte string?
For example a Chinese UTF8 string which takes 3 bytes.
We can use maxlength in input object to limit string length.
It causes problems when it is inserted into database.
Do we have a validator which can check the max length in bytes of
a string?
Thanks.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_________________________________________________________________
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]