#30549 [Asn->Csd]: incorrect character translations for some ISO-8859 charsets
| From: | moriyoshi@php.net | Date: | Mon, 21 Feb 2005 07:50:06 +0000 |
| Subject: | #30549 [Asn->Csd]: incorrect character translations for some ISO-8859 charsets | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74329@lists.php.net to get a copy of this message | ||
ID: 30549
Updated by: moriyoshi@php.net
Reported By: david at davidheath dot org
-Status: Assigned
+Status: Closed
Bug Type: mbstring related
Operating System: linux
PHP Version: 4.3.9
Assigned To: moriyoshi
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-02-17 15:09:35] moriyoshi@php.net
Verified.
------------------------------------------------------------------------
[2005-02-11 01:00:38] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-02-03 04:47:11] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2004-10-25 13:32:53] david at davidheath dot org
oops, minor bug in that script. Line 35 should read:
printf(" incorrect mapping of char 0x%x: got 0x%x,
expected 0x%x\n", $fromChar, $unicodeCharNumber[''], $expectChar);
Corrected version of script for your cut+paste convenience:
<?php
testMapping('ISO-8859-7',
array(
0xa4=>0x20ac,
0xa5=>0x20af,
0xaa=>0x37a)
);
testMapping('ISO-8859-8',
array(
0xaf=>0xaf,
0xfd=>0x200e,
0xfe=>0x200f)
);
testMapping('ISO-8859-10',
array(
0xa4=>0x12a
)
);
function testMapping($targetEncoding, $map) {
print "Encoding: $targetEncoding\n";
foreach($map as $fromChar=>$toChar) {
$expectChar = $toChar;
// convert to UCS-4, which represents every possible unicode
// char as a single fixed width 32bit value
$unicodeChar=mb_convert_encoding(chr($fromChar), 'UCS-4LE',
$targetEncoding);
$unicodeCharNumber = unpack('L', $unicodeChar);
if ($expectChar!=$unicodeCharNumber[''] and ($expectChar!=0 and
$unicodeCharNumber!=0x3f)) {
printf(" incorrect mapping of char 0x%x: got 0x%x,
expected 0x%x\n", $fromChar, $unicodeCharNumber[''], $expectChar);
}
}
}
?>
------------------------------------------------------------------------
[2004-10-25 10:33:42] derick@php.net
Hello David,
can you please make a *short* script that show that the warnings are
wrong as it takes quite some time to figure out what your script is
exactly doing.
regards,
Derick
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/30549
--
Edit this bug report at http://bugs.php.net/?id=30549&edit=1