Bug #4010: Unable to get recode_string to work
| From: | krist at fast dot no | Date: | Mon, 03 Apr 2000 15:46:43 +0000 |
| Subject: | Bug #4010: Unable to get recode_string to work | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17547@lists.php.net to get a copy of this message | ||
From: krist@fast.no
Operating system: linux redhat 6.1
PHP version: 3.0.15
PHP Bug Type: Misbehaving function
Bug description: Unable to get recode_string to work
I'm running apache 1.3.12 with php 3.0.15 compiled with GNU recode 3.5c
on linux redhat 6.1.
The GNU recode package is to be used for converting between different
encodings. When calling the recode program from the command line, I can easily convert from
ISO-8859-1 to UTF-8 and then back to ISO-8859-1, ending up with the same result as I started with.
When I use the recode program from within php, I'm not able to convert
back to ISO-8859-1.
The php test code looks like this:
$a = "øåæ" ;
$b = recode_string("ISO-8859-1..UTF-8", $a) ;
$c = recode_string("UTF-8..ISO-8859-1", $b) ;
print "a = $a<br>" ;
print "b = $b<br>" ;
print "c = $c<br>" ;
The output should be $c with the same value as $a, but all I get is
a = øåæ
b = øåæ
c =
Am I using the program correctly ? Is this a known bug ? Is there any way I can debug it ?
Thanks,
Kristian Halle
krist@fast.no