1 (edited by MasterDee 2008-01-22 5:09:16 PM)

Topic: Special characters won't work no matter how hard I'am trying!

Hello!

Half of a day I'am trying to show special character on a page, I put into form "??

Re: Special characters won't work no matter how hard I'am trying!

With XHTML, you should use an XML header to specify the XML encoding (the meta tag would probably work if you were using HTML ?.?)

This is what we use in the xajax HTML Control Library:

[code php]
print '<' . '?' . 'xml version="1.0" encoding="' . $this->sEncoding . '" ' . '?' . ">\n";
[/code]

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct

Re: Special characters won't work no matter how hard I'am trying!

I came to conclusion that new ver. 0.5 is really Beta and will not work with special characters, old ver. 0.2.5 works fine, without any encoding setting.

Special Characters (??

Re: Special characters won't work no matter how hard I'am trying!

Are you sure that your special characters are working in ISO-8859-1? In UTF8 mode it works pretty fine here, even in 0.5beta4.

Re: Special characters won't work no matter how hard I'am trying!

q_no wrote:

Are you sure that your special characters are working in ISO-8859-1? In UTF8 mode it works pretty fine here, even in 0.5beta4.

ohh my god Admin, my mistake. The problem was that I'am working in Win XP environment, and php file was saved/upload on server in win-1250 charset. when I set PHP Editing software to UTF-8 and upload on this format, every thing works fine.

Here is the final code and works now, without any char settings. File must be saved and upload in UTF-8, that's it.
[code]<?php

define("ROOT_DIR", "/home/root/");
 
require ROOT_DIR."/xajax/xajax_core/xajax.inc.php"; 

function testEncoding($strText)
{
        $objResponse = new xajaxResponse();
        $objResponse->alert("$strText"); 
        $objResponse->assign("div1","innerHTML", $strText);
   
        return $objResponse;
}

$xajax = new xajax();
$xajax->register(XAJAX_FUNCTION, "testEncoding");
$xajax->processRequest();


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sl-si" lang="sl-si" >
<head>
<title>TEST ??

Re: Special characters won't work no matter how hard I'am trying!

Could some one send a xajax already configured to using ISO-8859-1?
Thats my code:
$xajax->setCharEncoding('ISO-8859-1');

and in xajax.inc.php i did not find the define ('XAJAX_DEFAULT_CHAR_ENCODING', 'utf-8');
i just found
if (!defined ('XAJAX_DEFAULT_CHAR_ENCODING')) define ('XAJAX_DEFAULT_CHAR_ENCODING', 'utf-8');
and put
if (!defined ('XAJAX_DEFAULT_CHAR_ENCODING')) define ('XAJAX_DEFAULT_CHAR_ENCODING', 'ISO-8859-1');
but still dont show the correct... show "?" in  a black square.

Someone can help me?

Re: Special characters won't work no matter how hard I'am trying!

I suggest you leave the xajax code alone and instead configure the encoding from your script file... the key here is to ensure that your script editor saves the file in the encoding that you want (and tell xajax what encoding you want).  If you just tell xajax, the php engine will still tell the browser otherwise (which often causes the problem you describe)

Most programming style text editors allow you to control the file encoding.

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct

Re: Special characters won't work no matter how hard I'am trying!

now i using
utf8_encode(string);

and is working...

thank's

Re: Special characters won't work no matter how hard I'am trying!

xAJAX Support cp1251?????

Re: Special characters won't work no matter how hard I'am trying!

LOL My Noobs coding smile $msgoff = iconv("UTF-8","cp1251","$msgoff");

Re: Special characters won't work no matter how hard I'am trying!

XAJAX should support cp1251 the same way it supports ISO-8859-1 - GREAT on every server I've worked on except one single server that's being supported by lazy bastards who don't even want to hear about installing new software, or even worse - installing updates smile.

Re: Special characters won't work no matter how hard I'am trying!

Today i upgraded my firefox to 3.6.
As where firefox 3.5 never had a problem with special chars with umlauts, and other special chars, today firefox complained about these.
I just added the utf8_encode function within the output "channel", and there it is ok again..

Re: Special characters won't work no matter how hard I'am trying!

Just try to configure your xajax instance with:

$xajax->configure('characterEncoding', 'iso-8859-15');

*-15 seems to me to have solved all my problems.

Let me know.

Re: Special characters won't work no matter how hard I'am trying!

Thank you for it.runescape gold rs gold runescape money.