| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 8155|Reply: 7
Collapse the left

long of username in arabic !

[Copy link]

 Palestine

Post time: 2012-01-26 18:07
| Show all posts |Read mode
hi all ,

i try to register by arabic name in localhost Length of the username (The number of characters) is 8


After entry there massege show "username is longer than 15 characters ) but when i write 8 characters in english lang did'nt show this massege ?!


This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x
Post time: 2012-01-26 18:18
| Show all posts
Edited by mr.alone at 2012-1-26 18:19

1 arabic charecters is equal 3 latin charecters, this problem is not only for usernames, blog title, article title, therd title and many more have same problem

Comments

the problem in usernames only , try in make topic in our forums  Post time 2012-01-26 18:55

 Russia

Post time: 2012-01-26 18:32
| Show all posts
It is because of the engine developers does not feel a difference between the strlen() and mb_strlen() functions,
and most of translators does not feel a difference between bytes and characters.

Comments

how to slove it ?  Post time 2012-01-26 18:55

 Russia

Post time: 2012-01-26 19:02
| Show all posts
The original "username" database field length is only 15 bytes;
Multilingual version expands it to 64 bytes, so it is possible to enter about 20~32 multi-byte characters.
The problem is only in the length verification algorithm.
It requires the username length must be not longer than 15 bytes.

It is a reason to patch this algorithm co calculate the length in characters....

 Palestine

 Author| Post time: 2012-01-26 19:21
| Show all posts
i  have The solution but it isn't Suitable for non-Arabic username

 Russia

Post time: 2012-02-02 10:59
| Show all posts
I have digged the problem.
Javascript can calculate a string length only in CHARACTERS.
And Javascript can NOT calculate an UTF-8 string length in BYTES.

The beautifull O'Reilly explain me how JS store characters in UTF-16,
and give me an idea how to count the byte-length for UTF-8 strings.
I have wrote a JS function "utf8length()" and now testing it.
If the test will ok, I'll integrate this function into iX2.

 Russia

Post time: 2012-02-02 15:03
| Show all posts
Solved.
r334.
Post time: 2012-02-02 23:29
| Show all posts
Really nice work, thanks a lot
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-11-22 04:23 GMT+3 , Processed in 0.077106 sec., 14 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list