ID: 36994
User updated by: ynynmzvqofeaz at mailinator dot com
Reported By: ynynmzvqofeaz at mailinator dot com
Status: Assigned
Bug Type: mbstring related
Operating System: Linux
PHP Version: 4.4.2
Assigned To: hirokawa
New Comment:
Ignore the last comment. Do this:
Create two files with the following content, and name them test_iso1
and test_utf8:
<?php
echo mb_detect_encoding("testä");
?>
Make sure the encoding is correct:
$ file test_iso1
should return iso-8859-1
$ file test_utf8
should return utf-8
If they do not return the correct encoding, use iconv to convert them,
e.g.
$ iconv -f utf-8 -t iso-8859-1 test_iso1 >test_iso1.fixed
or
$ iconv -f iso-8859-1 -t utf-8 test_utf8 >test_utf8.fixed
Now run each script. The test_iso1 script should return a type of iso1,
the test_utf8 script should return a type of utf8.
Workaround: append an extra character to the end of the string, and
then remove it(!)
Previous Comments:
------------------------------------------------------------------------
[2006-04-10 07:02:09] ynynmzvqofeaz1 at mailinator dot com
*sigh*
<?php
echo mb_detect_encoding("testä");
?>
use iconv -f utf-8 -t iso-8859-1 INFILE > OUTFILE
if "file OUTFILE" says utf-8.
------------------------------------------------------------------------
[2006-04-07 17:28:21] [EMAIL PROTECTED]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.
If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2006-04-06 11:49:43] ynynmzvqofeaz at mailinator dot com
Description:
------------
mb_detect_encoding returns wrong result when text contains a trailing
accent.
See http://www.php.net/manual/en/function.mb-detect-encoding.php#55228
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36994&edit=1