• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

[FIX] Encoding Problem

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
21 posts • Page 2 of 2 • 1, 2

Postby motosdeagua.es » Wed May 10, 2006 4:12 pm

I need to use ISO-8859-15 for the characters (€, á, é, í, ó, ú, ñ, ....)
I've tried everything and fault.

If doing the simple things it was working well, I would don't anything any more.

Please, Could you put a code to me PHP that works gathering the variable of the URL?
example: http://www.motosdeagua.es/modules/chat/ ... r=yourname

Thank you very much, and sorry to ask as much :(
My challenge is make working to phpfreechat with postnuke!
Moving phpfreechat to Spain!
- www.motosdeagua.es -
motosdeagua.es
Member
 
Posts: 35
Joined: Tue May 02, 2006 12:24 pm
Location: SPAIN
  • Website
Top

Postby phpfreechat » Wed May 10, 2006 5:36 pm

UTF-8 cover the whole unicode so €, á, é, í, ó, ú, ñ, arabic characteres, chinese characteres ... are all included in the UTF-8 encoding.
So, just use UTF-8 for your page content.

For the nickname the question is to know how it is encoded in the url, maybe it depends on the system and maybe it depends on the browser :S
The cleaner solution is to get the nickname from somewhere else, maybe in the session ? When you build your url, where do you get the nickname ?

I made a small demo to illustrate the nickname problem : http://www.phpfreechat.net/tmp/chat-mot ... hp?user=stéphane
(look at the source code)
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby motosdeagua.es » Thu May 11, 2006 8:42 am

What explanation has this fails? :(:(:(
http://www.motosdeagua.es/modules/chat/ ... hp?user=stéphane


It's the same code. Is possible some dependent file? :(
My challenge is make working to phpfreechat with postnuke!
Moving phpfreechat to Spain!
- www.motosdeagua.es -
motosdeagua.es
Member
 
Posts: 35
Joined: Tue May 02, 2006 12:24 pm
Location: SPAIN
  • Website
Top

Postby phpfreechat » Thu May 11, 2006 9:29 am

Nickname convertion doesn't seams to work n your system ...

I suspect your don't have iconv on your system, could you try this little script :
Code: Select all
<?php
if (function_exists('iconv')) {
   echo "iconv is enabled on this system.<br />n";
} else {
   echo "iconv is disabled on this system.<br />n";
}
?>
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby motosdeagua.es » Thu May 11, 2006 9:42 am

iconv is disabled on this system. :(:(:( some solution?
Last edited by motosdeagua.es on Thu May 11, 2006 12:30 pm, edited 1 time in total.
My challenge is make working to phpfreechat with postnuke!
Moving phpfreechat to Spain!
- www.motosdeagua.es -
motosdeagua.es
Member
 
Posts: 35
Joined: Tue May 02, 2006 12:24 pm
Location: SPAIN
  • Website
Top

Postby motosdeagua.es » Fri May 12, 2006 11:25 am

SOLVED!!! :)
Code: Select all
<?php

require_once dirname(__FILE__)."/../src/phpfreechat.class.php";
$pnnick = $_REQUEST['user'];
$params =  array("title"   => "mychat",
             "serverid"       => md5(__FILE__),
             "language"      => "es_ES",
                 "theme"          => "blune",
                 "frozen_nick"    => true,
                 "nick"  =>  utf8_encode($pnnick),
                 );

$chat = new phpFreeChat( $params );

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
   <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />
    <title>Chat</title>

    <?php $chat->printJavascript(); ?>
    <?php $chat->printStyle(); ?>

  </head>

  <body>
    <?php $chat->printChat(); ?>

<?php
  // print the current file
  echo "<h2>The source code</h2>";
  $filename = __FILE__;
  echo "<p><code>".$filename."</code></p>";
  echo "<pre style="margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;">";
  $content = file_get_contents($filename);
  echo htmlentities($content);
  echo "</pre>";
?>

  </body>
</html>
My challenge is make working to phpfreechat with postnuke!
Moving phpfreechat to Spain!
- www.motosdeagua.es -
motosdeagua.es
Member
 
Posts: 35
Joined: Tue May 02, 2006 12:24 pm
Location: SPAIN
  • Website
Top

Previous

Post a reply
21 posts • Page 2 of 2 • 1, 2

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 11 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub