note 97902 modified in function.mb-convert-encoding by danbrown
| From: | danbrown@php.net | Date: | Fri, 14 May 2010 15:01:58 +0000 |
| Subject: | note 97902 modified in function.mb-convert-encoding by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169242@lists.php.net to get a copy of this message | ||
I've been trying to find the charset of a norwegian (with a lot of ø, æ, å) txt file
written on a Mac, i've found it in this way:
<?php
$text = "A strange string to pass, maybe with some ø, æ, å characters.";
foreach(mb_list_encodings() as $chr){
echo mb_convert_encoding($text, 'UTF-8', $chr)." :
".$chr."<br>";
}
?>
The line that looks good, gives you the encoding it was written in.
Hope can help someone
--was--
I've been trying to find the charset of a norwegian (with a lot of ø, æ, å) txt file
written on a Mac, i've found it in this way:
$text = "A strange string to pass, maybe with some ø, æ, å characters.";
foreach(mb_list_encodings() as $chr){
echo mb_convert_encoding($text, 'UTF-8', $chr)." :
".$chr."<br>";
}
The line that looks good, gives you the encoding it was written in.
Hope can help someone
http://php.net/manual/en/function.mb-convert-encoding.php