Skip to Content Skip to Menu

(SOLVED+FIX) Realnames character encoding bug

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
16 years 4 months ago #62469 by slabbi
Fix for Autocompleter:

1. uddeim.php: uddeIMcompleteUserName()

After "$input = trim(...)" add one line with "iconv".
Since special characters are UTF-8 encoded when sent I convert these into the character which is used on your site (and your database).

[code:1]
$input = trim( class_exists('JRequest') ? JRequest::getVar('value') : mosGetParam($_REQUEST, 'value', '') );
$input=iconv('UTF-8',$config->charset,$input);
[/code:1]

2. uddeim.php: uddeIMcompleteUserName()

Convert all special characters into UTF-8. This is required since the client expects UTF-8.

[code:1]
// assign results
foreach ( $results as $item ) {
$temp = $item->displayname;
$temp = iconv($config->charset,'UTF-8',$temp);
$items[] = rawurlencode($temp);
}
[/code:1]

3. include.php: uddeIMdoAutocomplete()

The characters are encoded, so unencode these characters.

[code:1]
choice = decodeURI(choice); // was "choice = unescape(choice);"
[/code:1]


Fix for "Shows wrong encoding in recipient box when called from a 3rd party component":

In includes.php and public.php you will find some lines with htmlentities() (search for "htmlentities"):

Modify all occurrences of
[code:1]htmlentities($xxxxxxxxxx, ENT_QUOTES)[/code:1]
with
[code:1]htmlentities($xxxxxxxxxx, ENT_QUOTES, $config->charset)[/code:1]

Do not change the first parameter which I have noted as "$xxxxxxx" here.


Note, that you have to specify which character set you are using in the system tab. When you are using J!1.5 this should be "UTF-8". In Joomla 1.0 (german) it should be "ISO8859-1".

Post edited by: slabbi, at: 2008/05/07 16:01

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

  • grvulture
  • grvulture
  • OFFLINE
  • Posts: 10
  • Thanks: 0
  • Karma: 18
16 years 4 months ago #62889 by grvulture
Replied by grvulture on topic Re:(SOLVED+FIX) Realnames character encoding bug
THANK YOU slabbi!! You are a savior!!

I will go now to make the changes to my .php's

thanks again friend!

SUPER ACTIVITY PLUGIN:
www.axxis.gr/super_activity/

Please Log in or Create an account to join the conversation.

  • GUEST
16 years 2 months ago #66653 by
Very very very very great! Thank you (had same prob) very very very much! And thanks also for the very very very good descriptions!
Bye - Peter

Please Log in or Create an account to join the conversation.

16 years 4 days ago #74467 by unformatted
Replied by unformatted on topic Re:(SOLVED+FIX) Realnames character encoding bug
I'm using 1.3 with portuguese language, and at autocomplete and when send by S4J on-line users module, the users with special characters not show correctly.But on combo box list is fine.

I have to edit this files? Or the hotfix solve this?
thanks

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
16 years 4 days ago #74477 by slabbi
Well, don't know S4J so I do not know what this module does.

The Autocompleter requires that the text is transfered UTF8 encoded and converted into the correct character set on client site. Please check the character set setting in the system tab. When you run J1.5 it should be UTF-8, when you use J1.0 you should enter the same encoding you are using for your template, e.g. ISO-8859-1 or ISO-8859-2 or whatever...

The fixes above are already implemented in uddeIM 1.3 and there is no other fix for that available since it should work fine now.

You can send me a login to your site if you like but there might be the possibility that you have to disable the autocompleter for your site if there is no solution.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer

Please Log in or Create an account to join the conversation.

Moderators: beatnantslabbikrileon
Powered by Kunena Forum