SMF Support > SMF 1.1.x Support

problrm with PM and special characters

<< < (2/2)

SamiBH:

--- Quote from: MrPhil on May 01, 2012, 10:10:27 AM ---So you're not actually typing in the name with the funny symbols, but replying to a PM or otherwise letting the system fill in the name?
--- End quote ---

yes


--- Quote from: MrPhil on May 01, 2012, 10:10:27 AM --- It also happens when you try to type in the name, with a character such as a (tm) cut and pasted from your own forum?
--- End quote ---

yes


--- Quote from: MrPhil on May 01, 2012, 10:10:27 AM ---I seem to recall seeing complaints long ago about PM having trouble with user names containing odd characters. Have you done a thorough search of this forum? I don't remember if it was happening in your circumstances, or only when trying to type in a name (or use the auto-complete). Maybe if you find those discussions there will be some information there that can point us in the right direction.
--- End quote ---

thank you , did that already nothing helped


--- Quote from: MrPhil on May 01, 2012, 10:10:27 AM ---By the way, was your forum originally in another encoding (Latin-x) and you converted it over to UTF-8?
--- End quote ---

yes it was.


--- Quote from: MrPhil on May 01, 2012, 10:10:27 AM ---
 Are any of these offending names dating from pre-UTF-8 times? If so, they probably have the wrong byte(s) for the special (non-ASCII) characters. I don't know if the conversion to UTF-8 takes care of them. Can you tell if the characters in question are a single byte or multiple bytes? You might have to cut and paste them into a file and examine it under a hex editor, or an editor that can switch between UTF-8 and Latin-1. You might even be able just to display their name in your forum and see what switching your browser to Latin-1 does (View > Character Encoding)... do the special characters change to a stream of odd accented characters? If so, they are in UTF-8. If not, they never got converted to UTF-8, and may still be Latin-1 or even CP-1252 (originally cut and pasted from Word).
--- End quote ---

the users are after converting to utf-8.



--- Quote from: MrPhil on May 01, 2012, 10:10:27 AM ---In your original post, you showed some text that was a string of ? and invalid character markers. It is not in UTF-8 and you are trying to display it in UTF-8. Is this text Arabic? Where did it come from -- language support file or a post?

--- End quote ---

it's Arabic from a post in the forum.

Arabic shows fine in the forum, only after adding  ' $db_character_set = 'utf8'; ' in Settings.php Arabic becomes like this "�?�?�??�?�"

MrPhil:
Without the $db_character_set = 'utf8'; line, Arabic text displays OK (both language support files and posts)? You've gone to your browser's View > Character Encoding and confirmed that the page is in UTF-8 (also, View > Page Source and see <meta> "charset=UTF-8" tag)? When you add the $db_character_set = 'utf8'; line, none of the Arabic posts display now? What do View > Character Encoding and the 'charset' meta tag show? To get the ?-in-diamond "invalid character" glyph, it must be in UTF-8 now but the text is still another encoding, which seems to imply that it may not have been UTF-8 you were looking at earlier. These are recent posts entered after the (supposed) conversion to UTF-8? Does phpMyAdmin show the database to be in UTF-8 ("collation" includes "utf8", not "latin1")?

Note that I've seen servers misconfigured to force Latin-1 encoding, despite having a "charset=UTF-8" meta tag. However, if your Arabic text shows up OK, I would suspect that the server is not forcing Latin-1.

SamiBH:
ok I found the problem.

I use custom file to Register users to my forum. if the username have special characters the problem happens

why, SMF uses "strtolower" to register username but my file don't .

with my file:
ĎӨӨレレα尺 >>becomes>> ĎӨӨレレα尺

with SMF:
ĎӨӨレレα尺 >>becomes>> ďөөレレα尺

so every time I try to send PM to "ĎӨӨレレα尺" SMF makes it "ďөөレレα尺" and don't find the user of course.

to fix this (if you have the same problem).

change:-

Subs-Auth.php---
from:

--- Code: --- // Add slashes, trim, and fix wildcards for each name.
$names[$i] = addslashes(trim($func['strtolower']($name)));
--- End code ---
to:

--- Code: --- // Add slashes, trim, and fix wildcards for each name.
$names[$i] = addslashes(trim($name));
--- End code ---
.................................................
PersonalMessage.php--
from:

--- Code: --- $input[$rec_type][$index] = $func['htmlspecialchars']($func['strtolower'](stripslashes(trim($member))));
--- End code ---
to:

--- Code: --- $input[$rec_type][$index] = $func['htmlspecialchars']((stripslashes(trim($member))));
--- End code ---

from:

--- Code: --- if (array_intersect(array($func['strtolower']($member['username']), $func['strtolower']($member['name']), $func['strtolower']($member['email'])), $to_members))
--- End code ---
to:

--- Code: --- if (array_intersect(array(($member['username']), $func['strtolower']($member['name']), $func['strtolower']($member['email'])), $to_members))
--- End code ---


from:

--- Code: --- $input[$rec_type] = array_diff($input[$rec_type], array($func['strtolower']($member['username']), $func['strtolower']($member['name']), $func['strtolower']($member['email'])));
--- End code ---

to:

--- Code: --- $input[$rec_type] = array_diff($input[$rec_type], array(($member['username']), $func['strtolower']($member['name']), $func['strtolower']($member['email'])));
--- End code ---


thank you MrPhil and sorry if I didn't make my problem clear :)

Navigation

[0] Message Index

[*] Previous page

Go to full version