|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
My forum is in Taiwan , many users use Chinese characters as their login name (column : USER_LOGIN_NAME) in UBB5 (It allowed special characters in login name long time ago . After UBB6 , it is disabled) , after migrating to UBB7 , these users cannot login.
How to solve it ?
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Aug 2006
Posts: 1,659 Likes: 1
Pooh-Bah
|
|
Pooh-Bah
Joined: Aug 2006
Posts: 1,659 Likes: 1 |
Is the box unchecked in Control Panel » Registration Settings » Basic Options » Allow Special Characters in Display Names?
Although, that does say "Display Names" and not login names, but perhaps verify that setting anyway and see if it helps...
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
Thank you . I solved it. It's related to generic.php:$ubbt_lang['CHARSET'] . After I change it to big5 , it works OK now.
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 16,532 Likes: 150
|
|
Joined: Jun 2006
Posts: 16,532 Likes: 150 |
Isn't the defualt UTF8? I thought it allowed for chinese/japanese special characters...
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
No , because of historical issues.
I used UBBT since WWWThreads (perl version) with mysql 3.23 , mysql didn't support i18n at that time , all Chinese characters were encoded in latin1 (8859_1).
After upgrading to UBBT 6 and MySQL 4 , the DB/table/column still encode in default latin1_swedish_ci.
I just need to set $ubbt_lang['CHARSET'] to BIG5 and it works fine.
I know UTF8 encoding maybe the ultimate solution. But I don't know how to change the whole DB/TABLE/column encoded to UTF8 ... Can somebody give me some hints ?
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Aug 2006
Posts: 1,659 Likes: 1
Pooh-Bah
|
|
Pooh-Bah
Joined: Aug 2006
Posts: 1,659 Likes: 1 |
I don't know how to change the whole DB/TABLE/column encoded to UTF8 ... Can somebody give me some hints ? Can't this be done in phpMyAdmin?
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
Yes , it can be done . ex :
mysql> ALTER DATABASE xxx DEFAULT CHARACTER SET UTF8 COLLATE UTF8;
There are also commands to change TABLE/COLUMN's collation . But it only affects the newly inserted data , not the existing data.
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
After trying another accounts , I found MOST users with special characters in their Login_Name cannot login !
I don't know why , can somebody tell me what to do ? UBB6 is OK , But after upgrading , this is frustrating...
My DB encoding is UTF-8 , so , these special characters are saved in UTF8 format.
Does it related to start_page.inc.php or do_login() in ubbthreads.inc.php ? Is there any encoding trick inside ?
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
After tracing some old (UBBT6) and new (UBBT7) code , I found some difference... In UBBT6 , authentication is through $query = " SELECT U_Username, U_Laston, U_Password,U_Number,U_Language,... FROM {$config['tbprefix']}Users WHERE U_LoginName = '$Username_q' It seems it is direct String comparing ... But in UBBT7 , it's done by this : where t1.USER_LOGIN_NAME = ? and t1.USER_ID = t2.USER_ID and t1.USER_ID = t3.USER_ID
$sth = $dbh -> do_placeholder_query($query,array($Username),__LINE__,__FILE__); It seems the $Username is processed by array() , is this the problem that cause mose users (with special chars in LoginName) cannot login ? How to solve it ?
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
What's the error message they get when they try and login? That will at least let us know if it's not recognizing the username, or if it's a password issue.
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
When login , it shows generic.php:$ubbt_lang['NO_AUTH']
When I request new password , it shows start_page.php:$ubbt_lang['NO_EMAIL']
(I am sure I input correct data.)
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Do you still have the old database? So we know if we're debugging an importer problem or a script problem it would be helpful to compare the 2 entries in the database for both users to see if they are the same.
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
Hi , here are attachments : ubb6 and ubb7 , for the same user.
mysql> select U_Number , U_LoginName , U_Password from w3t_Users where U_Number = 874 into OUTFILE 'ubb6.txt';
mysql> use ubbthreads7
Database changed
mysql> select USER_ID ,USER_LOGIN_NAME , USER_PASSWORD from ubbt_USERS where USER_ID = '838' into OUTFILE 'ubb7.txt';
This board can't add attachments , I attach files to here : https://www.ubbcentral.com/forums/ubbthreads.php?ubb=showflat&Number=171376
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 16,532 Likes: 150
|
|
Joined: Jun 2006
Posts: 16,532 Likes: 150 |
Rick, I think he's trying to say that the array is breaking with the non-latin characters.
|
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Looking at the screenshots, it looks like the values from the old database didn't get inserted into the new database properly. I know you had change the character type of the tables, after the import, but that might have needed to be done before hand.
To verify this, what you could try to do is register a new username with special characters in it and see if it works properly.
|
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
The array shouldn't cause anything with special characters as we pass all query values in an array in version 7. And if it didn't work on logins they wouldn't work anywhere.
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
Hi , I tried registering a new user with special characters in USER_LOGIN_NAME , and the user can successfully login . The data in MySQL is correct , can be selected correctly .
I suspect the importers script has some problem transferring from U_LoginName to USER_LOGIN_NAME , can you check it out ?
As to Display Name , all U_Username to USER_DISPLAY_NAME seems OK , no matter whether it contains special chars .
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
That's strange that display name is ok, and the login name isn't. They are actually inserted in the same query in the import script, and we don't do any adjustments to either. We just query and then insert. I'll try a few tests. Are all login names with special characters this way or just some as far as you can tell?
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
Are all login names with special characters this way or just some as far as you can tell? It seems all login names with special chars cannot login correctly I just select a Chinese char , these are part of results . These users cannot login correctly. Here is the result ... https://www.ubbcentral.com/forums/u...&Number=171523&page=0#Post171523
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
Hi , maybe my previous import has some problems . I decide to do another import now . It's running , and till now , it seems everything is OK. (the script is running , it may take half day...) ![[Linked Image]](https://www.ubbcentral.com/forums/files/286-encodings2.gif)
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
|
Joined: Jun 2006
Posts: 215
enthusiast
|
|
enthusiast
Joined: Jun 2006
Posts: 215 |
Hi , after I re-import the whole DB , the problem solved. I still didn't get it , why my first import has this problem...
English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
|
|
|
|
1 members (1 invisible),
304
guests, and
96
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
|