Encoding problem with command line PHP.exe
| From: | Emile Axelrad | Date: | Fri, 12 Jul 2002 21:00:19 +0000 |
| Subject: | Encoding problem with command line PHP.exe | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-107431@lists.php.net to get a copy of this message | ||
Hello - My problem is as follows:
<?
$data = mssql_result(mssql_query("SELECT Field FROM table WHERE
ID='1'"),0);
echo $data;
mysql_insert("INSERT INTO table2 VALUES('$data')");
?>
The data in the MSSQL table is: Æã
IF I call this PHP code from my browser (IE6) it results in the
following output:
Æã
and it also places into the MySQL database the value: Æã
However, if I call this PHP code from the command line, using "php.exe
test.php" it also results in the following output:
Æã
but it places into the MySQL database: Æ
Does anyone have any idea why this is happening? I am sure it is a
character set issue, but for the life of me I cannot work out why the
command-line does not run the exact same script in the same way as a
browser would?
Regards,
Emile Axelrad, <mailto:emile.axelrad@connect.co.uk>
emile.axelrad@connect.co.uk