The designated maximum length text fields do not correspond to the actual, in the Russian charsets (UTF-8-general-ci).
It is less than three times. A English encoding no problems :(

Example: If I set a length field of 30 characters, it can enter only 10 (Russians charsets) or 30 English charsets.
After submitting forms error message exceeding the limit, which does not meet reality.

Thank you for your attention.

CommentFileSizeAuthor
#3 text_module_strlen.patch819 bytestema

Comments

magway@drupal.ru’s picture

Solution.
In function text_field() (file text.module) replace line
if (strlen($data['value']) > $field['max_length']) {
with
if (mb_strlen($data['value'],"UTF-8") > $field['max_length']) {
That seems to work.

Shaltay’s picture

Hello.

Using drupal_strlen() seems to be a better solution

tema’s picture

Title: Wrong permissible length text fields in the Russian character » Wrong result of strlen() with UTF-8 characters generates a validation error
Assigned: MDD » Unassigned
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new819 bytes

The Russians are still not coming? Ok, here's a patch.

karens’s picture

Status: Needs review » Closed (won't fix)

The D5 version is no longer being supported. Sorry.