Hi,
I have a problem with validation of textfields.
Example:
A model contains an attribute called "USERNAME". The validation rule looks like that:
array('USERNAME','length', 'max'=>15),
The application generates an form, using an ActiveTextField for attribute USERNAME an Yii generates the following HTML code:
<input type="text" maxlength="15" id="Model_USERNAME" name="Model[USERNAME]">
As you can see "maxlength" is taken from the validation rule. Everythnig works fine as long as u use typical ASCII letters (a-zA-Z0-9).
A problem occurs, if you use multibyte-chracter, such es ä,ö,é,ß and so on.
The text field still allowed 15 letters, so it doesn’t matter if you type
Ronald McDonald
or
Rüdiger Bergers
or
André Leromanés
But the validation returns "false" for "Rüdiger Bergers" or "André Leromanés"…i think because of the multibyte characters. "Rüdiger Bergers" is 16 Bytes long, "André Leromanés" 17 Bytes
Is there a way to enable "validation for attributes with multibyte characters"?
Or is there an idea for an workaround?
…or is this a bug of yii?
Thank you,
rall0r.