FreiChat related discussions
Unicode User names appear as ???????

Thanks for this wonderful chat system.
I use the latest version in Joomla and it works very well but I would like to modify the code to let the username appears in Unicode. I have for the moment questions mark instead of the real username. Can you tell me which file I should modify. In the Chat text area and the text input I can use Unicode but not in the head and in the userlist.
Thank you for your help.
Yours,
Buc

Thanks for this wonderful chat system. I use the latest version in Joomla and it works very well but I would like to modify the code to let the username appears in Unicode. I have for the moment questions mark instead of the real username. Can you tell me which file I should modify. In the Chat text area and the text input I can use Unicode but not in the head and in the userlist. Thank you for your help. Yours, Buc

i did not notice that usernames had unicode issues. The earlier versions of FreiChat had unicode problems in the message body.
I will fix this issue in the next version (New versions are released every 10-15 days)
Till then you can set the backend option to 'username' instead of 'nickname'
Thanks for notifying about this issue

i did not notice that usernames had unicode issues. The earlier versions of FreiChat had unicode problems in the message body. I will fix this issue in the next version (New versions are released every 10-15 days) Till then you can set the backend option to 'username' instead of 'nickname' Thanks for notifying about this issue
Necessity is the mother of all inventions!

in the file ~/freichat/define.php

around line 75, you will find the below code

$this->freichat_debug("connected to database successfully");


Add the following lines of code after that
$this->db->Execute("SET character_set_results = 'utf8', character_set_client ='utf8',character_set_connection='utf8', character_set_database = 'utf8', character_set_server = 'utf8'");


and if everything goes well, you will be able to see usernames in your desired language.
this patch will be implemented in the next version.

in the file ~/freichat/define.php around line 75, you will find the below code <code> $this->freichat_debug("connected to database successfully"); </code> Add the following lines of code after that <code> $this->db->Execute("SET character_set_results = 'utf8', character_set_client ='utf8',character_set_connection='utf8', character_set_database = 'utf8', character_set_server = 'utf8'"); </code> and if everything goes well, you will be able to see usernames in your desired language. this patch will be implemented in the next version.
Necessity is the mother of all inventions!

Well thank you for your quick answer!
However this works in the head of the message box (the user-name appear in my language) but not in the users list below users in the main box where I can read: No One Is On-line! That is strange because when I have a look in the database frei_session the name in Unicode Utf8 appears well in my language... So maybe there is a problem in the function which search for on-line users...

Maybe it is not clear... I have tried to change my profile picture as the screen shoot of the problem but too small...

As you can see on the left: no users are online but on the right it is ok when I use root profile. But in fact those two users are online!

Well thank you for your quick answer! However this works in the head of the message box (the user-name appear in my language) but not in the users list below users in the main box where I can read: No One Is On-line! That is strange because when I have a look in the database frei_session the name in Unicode Utf8 appears well in my language... So maybe there is a problem in the function which search for on-line users... Maybe it is not clear... I have tried to change my profile picture as the screen shoot of the problem but too small... As you can see on the left: no users are online but on the right it is ok when I use root profile. But in fact those two users are online!

make sure you clear all the cookies.(empty the freichat tables if possible) Then login using 2 different browsers with different usernames.
The search function which you are talking about isn't flawed, i've tested it with different names from different languages and it worked perfectly ,and this search function is one of the oldest(7 months) and the most stable function.

There must be something else that is causing the problem.

By the way which version of joomla are you using? are you using CB or Jomsocial?

make sure you clear all the cookies.(empty the freichat tables if possible) Then login using 2 different browsers with different usernames. The search function which you are talking about isn't flawed, i've tested it with different names from different languages and it worked perfectly ,and this search function is one of the oldest(7 months) and the most stable function. There must be something else that is causing the problem. By the way which version of joomla are you using? are you using CB or Jomsocial?
Necessity is the mother of all inventions!

I use Joomla 1.5.22 and kunena Forum 1.6.3 but I don't use JoomSocial or CB.

I have tried it from the beginning: clear all 2 FrieChatx databases uninstall the directory and reinstall it with the installation procedure then modify define.php as you said.
I have cleared the cache and cookies etc..., on Firefox and Opera which I use for testing the Chat component.

And unfortunately, the result is the same as I told you yesterday:
It seems that the users list recognize usernames if they are not in my language script utf8, but when I activate the dialog, the name in UTF8 appears well on the head of the messagebox.

So, to be clear, if define.php isn't modified it works but the username (in my language) appears as ????, if I modify define.php, I get the message "no-user is online".

What is very strange is when I have a look in the database, Frie_session contents the username in utf8 compared to ???? if define.php isn't modified.

I use Joomla 1.5.22 and kunena Forum 1.6.3 but I don't use JoomSocial or CB. I have tried it from the beginning: clear all 2 FrieChatx databases uninstall the directory and reinstall it with the installation procedure then modify define.php as you said. I have cleared the cache and cookies etc..., on Firefox and Opera which I use for testing the Chat component. And unfortunately, the result is the same as I told you yesterday: It seems that the users list recognize usernames if they are not in my language script utf8, but when I activate the dialog, the name in UTF8 appears well on the head of the messagebox. So, to be clear, if define.php isn't modified it works but the username (in my language) appears as ????, if I modify define.php, I get the message "no-user is online". What is very strange is when I have a look in the database, Frie_session contents the username in utf8 compared to ???? if define.php isn't modified.
What is very strange is when I have a look in the database, Frie_session contents the username in utf8 compared to ???? if define.php isn't modified.

That is the exact reason why i told you to modify define.php, but that doesn't seem to be working.
but the good news is, At last i was able to reproduce the same errors here at my localhost. So now i will understand what's going wrong but It will take some time to solve the bug though
<em>What is very strange is when I have a look in the database, Frie_session contents the username in utf8 compared to ???? if define.php isn't modified. </em> That is the exact reason why i told you to modify define.php, but that doesn't seem to be working. but the good news is, At last i was able to reproduce the same errors here at my localhost. So now i will understand what's going wrong but It will take some time to solve the bug though
Necessity is the mother of all inventions!

in ~/freichat/server/freichat.php , we use a function 'substr', it is used to cut long names, but it is not UTF-8 safe.
So what you can do is stop substr from being called.

search for 'substr' with a text-editor, you will find text as below

$guest = strlen($guest)>20 ? substr($guest,0,8)."..." : $guest;


it should now look like
$guest = strlen($guest)>2000 ? substr($guest,0,8)."..." : $guest;


and the next line:

<iframe src="http://pastebin.com/embed_iframe.php?i=pBvDdVuX" style="border:none;width:100%"></iframe>



it should look as below:

<iframe src="http://pastebin.com/embed_iframe.php?i=VHcdhXpV" style="border:none;width:100%"></iframe>
what we are doing is just stopping the condition which calls substr.

You might find that the names in the head section may get jumbled (I will fix this too) after a refresh
but that will be fixed soon

in ~/freichat/server/freichat.php , we use a function &#039;substr&#039;, it is used to cut long names, but it is not UTF-8 safe. So what you can do is stop substr from being called. search for &#039;substr&#039; with a text-editor, you will find text as below &amp;lt;code&amp;gt; $guest = strlen($guest)&amp;gt;20 ? substr($guest,0,8).&quot;...&quot; : $guest; &amp;lt;/code&amp;gt; it should now look like &amp;lt;code&amp;gt; $guest = strlen($guest)&amp;gt;2000 ? substr($guest,0,8).&quot;...&quot; : $guest; &amp;lt;/code&amp;gt; and the next line: &amp;lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=pBvDdVuX&quot; style=&quot;border:none;width:100%&quot;&amp;gt;&amp;lt;/iframe&amp;gt; it should look as below: &amp;lt;iframe src=&quot;http://pastebin.com/embed_iframe.php?i=VHcdhXpV&quot; style=&quot;border:none;width:100%&quot;&amp;gt;&amp;lt;/iframe&amp;gt; what we are doing is just stopping the condition which calls substr. You might find that the names in the head section may get jumbled (I will fix this too) after a refresh but that will be fixed soon
Necessity is the mother of all inventions!

It's working perfectly now.
Thank you for your time you spent on that problem.
Now I can tell you that your FrieChatX is now Unicode proof.
Yours,
Buc

It&#039;s working perfectly now. Thank you for your time you spent on that problem. Now I can tell you that your FrieChatX is now Unicode proof. Yours, Buc
107
9
0
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft