ScotlandPHP

utf8_decode

(PHP 4, PHP 5)

utf8_decode Converts a string with ISO-8859-1 characters encoded with UTF-8 to single-byte ISO-8859-1

Description

string utf8_decode ( string $data )

This function decodes data, assumed to be UTF-8 encoded, to ISO-8859-1.

Parameters

data

An UTF-8 encoded string.

Return Values

Returns the ISO-8859-1 translation of data.

See Also

  • utf8_encode() - Encodes an ISO-8859-1 string to UTF-8 (contains an explanation of UTF-8 encoding)

add a note add a note

User Contributed Notes 35 notes

up
19
deceze at gmail dot com
6 years ago
Please note that utf8_decode simply converts a string encoded in UTF-8 to ISO-8859-1. A more appropriate name for it would be utf8_to_iso88591. If your text is already encoded in ISO-8859-1, you do not need this function. If you don't want to use ISO-8859-1, you do not need this function.

Note that UTF-8 can represent many more characters than ISO-8859-1. Trying to convert a UTF-8 string that contains characters that can't be represented in ISO-8859-1 to ISO-8859-1 will garble your text and/or cause characters to go missing. Trying to convert text that is not encoded in UTF-8 using this function will most likely garble the text.

If you need to convert any text from any encoding to any other encoding, look at iconv() instead.
up
13
info at vanylla dot it
8 years ago
IMPORTANT: when converting UTF8 data that contains the EURO sign DON'T USE utf_decode function.

utf_decode converts the data into ISO-8859-1 charset. But ISO-8859-1 charset does not contain the EURO sign, therefor the EURO sign will be converted into a question mark character '?'

In order to convert properly UTF8 data with EURO sign you must use:

iconv("UTF-8", "CP1252", $data)
up
5
gabriel arobase gabsoftware dot com
6 years ago
If you want to retrieve some UTF-8 data from your database, you don't need utf8_decode().

Simply do the following query before any SELECT :

$result = mysql_query("SET NAMES utf8");
up
5
okx dot oliver dot koenig at gmail dot com
2 years ago
// This finally helped me to do the job, thanks to Blackbit, had to modify deprecated ereg:
// original comment: "Squirrelmail contains a nice function in the sources to convert unicode to entities:"

function charset_decode_utf_8 ($string) {
    /* Only do the slow convert if there are 8-bit characters */
    /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
    if (!preg_match("/[\200-\237]/", $string)
     && !preg_match("/[\241-\377]/", $string)
    ) {
        return $string;
    }

    // decode three byte unicode characters
    $string = preg_replace("/([\340-\357])([\200-\277])([\200-\277])/e",
        "'&#'.((ord('\\1')-224)*4096 + (ord('\\2')-128)*64 + (ord('\\3')-128)).';'",
        $string
    );

    // decode two byte unicode characters
    $string = preg_replace("/([\300-\337])([\200-\277])/e",
        "'&#'.((ord('\\1')-192)*64+(ord('\\2')-128)).';'",
        $string
    );

    return $string;
}
up
3
thierry.bo # netcourrier point com
12 years ago
In response to fhoech (22-Sep-2005 11:55), I just tried a simultaneous test with the file UTF-8-test.txt using your regexp, 'j dot dittmer' (20-Sep-2005 06:30) regexp (message #56962), `php-note-2005` (17-Feb-2005 08:57) regexp in his message on `mb-detect-encoding` page (http://us3.php.net/manual/en/function.mb-detect-encoding.php#50087) who is using a regexp from the W3C (http://w3.org/International/questions/qa-forms-utf-8.html), and PHP mb_detect_encoding function.

Here are a summarize of the results :

201 lines are valid UTF8 strings using phpnote regexp
203 lines are valid UTF8 strings using j.dittmer regexp
200 lines are valid UTF8 strings using fhoech regexp
239 lines are valid  UTF8 strings using using mb_detect_encoding

Here are the lines with differences (left to right, phpnote, j.dittmer and fhoech) :

Line #70 : NOT UTF8|IS UTF8!|IS UTF8! :2.1.1 1 byte (U-00000000): ""
Line #79 : NOT UTF8|IS UTF8!|IS UTF8! :2.2.1 1 byte (U-0000007F): ""
Line #81 : IS UTF8!|IS UTF8!|NOT UTF8 :2.2.3 3 bytes (U-0000FFFF): "" |
Line #267 : IS UTF8!|IS UTF8!|NOT UTF8 :5.3.1 U+FFFE = ef bf be = "" |
Line #268 : IS UTF8!|IS UTF8!|NOT UTF8 :5.3.2 U+FFFF = ef bf bf = "" |

Interesting is that you said that your regexp corrected j.dittmer regexp that failed on 5.3 section, but it my test I have the opposite result ?!

I ran this test on windows XP with PHP 4.3.11dev. Maybe these differences come from operating system, or PHP version.

For mb_detect_encoding I used the command :

mb_detect_encoding($line, 'UTF-8, ISO-8859-1, ASCII');
up
1
Aidan Kehoe <php-manual at parhasard dot net>
13 years ago
The fastest way I've found to check if something is valid UTF-8 is
<?php
if (iconv('UTF-8', 'UTF-8', $input) != $input) {
       
/* It's not UTF-8--for me, it's probably CP1252, the Windows
           version of Latin 1, with directed quotation marks and
           the Euro sign.  */
}
?>.
The iconv() C library fails if it's told a string is UTF-8 and it isn't; the PHP one doesn't, it just returns the conversion up to the point of failure, so you have to compare the result to the input to find out if the conversion succeeded.
up
1
sashott at gmail dot com
2 years ago
Use of utf8_decode was not enough for me by get page content from another site. Problem appear by different alphabet from standard latin. As example some chars (corresponding to HTML codes &bdquo; , &nbsp; and others) are converted to "?" or "xA0" (hex value). You need to make some conversion before execute utf8_decode. And you can not replace simple, that they can be part of 2 bytes code for a char (UTF-8 use 2 bytes). Next is for cyrillic alphabet, but for other must be very close.

function convertMethod($text){
    //Problem is that utf8_decode convert HTML chars for &bdquo; and other to ? or &nbsp; to \xA0. And you can not replace, that they are in some char bytes and you broke cyrillic (or other alphabet) chars.
    $problem_enc=array(
        'euro',
        'sbquo',
        'bdquo',
        'hellip',
        'dagger',
        'Dagger',
        'permil',
        'lsaquo',
        'lsquo',
        'rsquo',
        'ldquo',
        'rdquo',
        'bull',
        'ndash',
        'mdash',
        'trade',
        'rsquo',
        'brvbar',
        'copy',
        'laquo',
        'reg',
        'plusmn',
        'micro',
        'para',
        'middot',
        'raquo',
        'nbsp'
    );
    $text=mb_convert_encoding($text,'HTML-ENTITIES','UTF-8');
    $text=preg_replace('#(?<!\&ETH;)\&('.implode('|',$problem_enc).');#s','--amp{$1}',$text);
    $text=mb_convert_encoding($text,'UTF-8','HTML-ENTITIES');
    $text=utf8_decode($text);
    $text=mb_convert_encoding($text,'HTML-ENTITIES','UTF-8');
    $text=preg_replace('#\-\-amp\{([^\}]+)\}#su','&$1;',$text);
    $text=mb_convert_encoding($text,'UTF-8','HTML-ENTITIES');
    return $text;
}

If this don't work, try to set "die($text);" on some places to look, what is happen to this row. Is better to test with long text. It is very possible to broke other alphabet character. In this case, it is very possible, that for you alphabet set "&ETH;" is not the right one. You need to set "die($text);" after this preg_replace and look HTML code for character before set "--amp".
up
0
Aleksandr
3 months ago
In addition to note by yannikh at gmeil dot com, another way to decode strings with non-latin chars from unix console like

C=RU, L=\xD0\x9C\xD0\xBE\xD1\x81\xD0\xBA\xD0\xB2\xD0\xB0,

<?php preg_replace_callback('/\\\\x([0-9A-F]{2})/', function($a){ return pack('H*', $a[1]); }, $str); ?>

The code above will output:
C=RU, L=Москва,
up
0
kode68
1 year ago
Update Answer from okx dot oliver dot koenig at gmail dot com for PHP 5.6 since e/ modifier is depreciated

// This finally helped me to do the job, thanks to Blackbit, had to modify deprecated ereg:
// original comment: "Squirrelmail contains a nice function in the sources to convert unicode to entities:"

function charset_decode_utf_8($string)
    {
        /* Only do the slow convert if there are 8-bit characters */
        if ( !preg_match("/[\200-\237]/", $string) && !preg_match("/[\241-\377]/", $string) )
               return $string;

        // decode three byte unicode characters
          $string = preg_replace_callback("/([\340-\357])([\200-\277])([\200-\277])/",
                    create_function ('$matches', 'return \'&#\'.((ord($matches[1])-224)*4096+(ord($matches[2])-128)*64+(ord($matches[3])-128)).\';\';'),
                    $string);

        // decode two byte unicode characters
          $string = preg_replace_callback("/([\300-\337])([\200-\277])/",
                    create_function ('$matches', 'return \'&#\'.((ord($matches[1])-192)*64+(ord($matches[2])-128)).\';\';'),
                    $string);

        return $string;
    }

Enjoy
up
0
christoffer
4 years ago
The preferred way to use this on an array would be with the built in PHP function "array_map()", as for example:
$array = array_map("utf8_decode", $array);
up
1
gto at interia dot pl
13 years ago
Correction to function converting utf82iso88592 and iso88592tutf8.
Janusz forgot about "&#324;", and "&#380;" exchanged from "&#378;" here and there.

GTo

function utf82iso88592($tekscik) {
     $tekscik = str_replace("\xC4\x85", "&#261;", $tekscik);
     $tekscik = str_replace("\xC4\x84", '&#260;', $tekscik);
     $tekscik = str_replace("\xC4\x87", '&#263;', $tekscik);
     $tekscik = str_replace("\xC4\x86", '&#262;', $tekscik);
     $tekscik = str_replace("\xC4\x99", '&#281;', $tekscik);
     $tekscik = str_replace("\xC4\x98", '&#280;', $tekscik);
     $tekscik = str_replace("\xC5\x82", '&#322;', $tekscik);
     $tekscik = str_replace("\xC5\x81", '&#321;', $tekscik);
     $tekscik = str_replace("\xC5\x84", '&#324;', $tekscik);    
     $tekscik = str_replace("\xC5\x83", '&#323;', $tekscik);
     $tekscik = str_replace("\xC3\xB3", '', $tekscik);
     $tekscik = str_replace("\xC3\x93", '', $tekscik);
     $tekscik = str_replace("\xC5\x9B", '&#347;', $tekscik);
     $tekscik = str_replace("\xC5\x9A", '&#346;', $tekscik);
     $tekscik = str_replace("\xC5\xBC", '&#380;', $tekscik);
     $tekscik = str_replace("\xC5\xBB", '&#379;', $tekscik);
     $tekscik = str_replace("\xC5\xBA", '&#378;', $tekscik);
     $tekscik = str_replace("\xC5\xB9", '&#377;', $tekscik);
     return $tekscik;
} // utf82iso88592

function iso885922utf8($tekscik) {
     $tekscik = str_replace("&#261;", "\xC4\x85", $tekscik);
     $tekscik = str_replace('&#260;', "\xC4\x84", $tekscik);
     $tekscik = str_replace('&#263;', "\xC4\x87", $tekscik);
     $tekscik = str_replace('&#262;', "\xC4\x86", $tekscik);
     $tekscik = str_replace('&#281;', "\xC4\x99", $tekscik);
     $tekscik = str_replace('&#280;', "\xC4\x98", $tekscik);
     $tekscik = str_replace('&#322;', "\xC5\x82", $tekscik);
     $tekscik = str_replace('&#321;', "\xC5\x81", $tekscik);
     $tekscik = str_replace('&#324;', "\xC5\x84", $tekscik);
     $tekscik = str_replace('&#323;',"\xC5\x83", $tekscik);
     $tekscik = str_replace('', "\xC3\xB3", $tekscik);
     $tekscik = str_replace('', "\xC3\x93", $tekscik);
     $tekscik = str_replace('&#347;', "\xC5\x9B", $tekscik);
     $tekscik = str_replace('&#346;', "\xC5\x9A", $tekscik);
     $tekscik = str_replace('&#380;', "\xC5\xBC", $tekscik);
     $tekscik = str_replace('&#379;', "\xC5\xBB", $tekscik);
     $tekscik = str_replace('&#378;', "\xC5\xBA", $tekscik);
     $tekscik = str_replace('&#377;', "\xC5\xB9", $tekscik);    
     return $tekscik;
} // iso885922utf8
up
0
Blackbit
9 years ago
Squirrelmail contains a nice function in the sources to convert unicode to entities:

<?php
function charset_decode_utf_8 ($string) {
     
/* Only do the slow convert if there are 8-bit characters */
    /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */
   
if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string))
        return
$string;

   
// decode three byte unicode characters
   
$string = preg_replace("/([\340-\357])([\200-\277])([\200-\277])/e",        \
   
"'&#'.((ord('\\1')-224)*4096 + (ord('\\2')-128)*64 + (ord('\\3')-128)).';'",    \
   
$string);

   
// decode two byte unicode characters
   
$string = preg_replace("/([\300-\337])([\200-\277])/e", \
   
"'&#'.((ord('\\1')-192)*64+(ord('\\2')-128)).';'", \
   
$string);

    return
$string;
}
?>
up
0
punchivan at gmail dot com
9 years ago
EY! the bug is not in the function 'utf8_decode'. The bug is in the function 'mb_detect_encoding'. If you put a word with a special char at the end like this 'accentué', that will lead to a wrong result (UTF-8) but if you put another char at the end like this 'accentuée' you will get it right. So you should always add a ISO-8859-1 character to your string for this check. My advise is to use a blank space.
I´ve tried it and it works!

function ISO_convert($array)
{
    $array_temp = array();
    
    foreach($array as $name => $value)
    {
        if(is_array($value))
          $array_temp[(mb_detect_encoding($name." ",'UTF-8,ISO-8859-1') == 'UTF-8' ? utf8_decode($name) : $name )] = ISO_convert($value);
        else
          $array_temp[(mb_detect_encoding($name." ",'UTF-8,ISO-8859-1') == 'UTF-8' ? utf8_decode($name) : $name )] = (mb_detect_encoding($value." ",'UTF-8,ISO-8859-1') == 'UTF-8' ? utf8_decode($value) : $value );
    }

    return $array_temp;
}
up
0
haugas at gmail dot com
9 years ago
If you don't know exactly, how many times your string is encoded, you can use this function:

<?php

function _utf8_decode($string)
{
 
$tmp = $string;
 
$count = 0;
  while (
mb_detect_encoding($tmp)=="UTF-8")
  {
   
$tmp = utf8_decode($tmp)note" id="83051"> $count0s1 or PHPA!au-1 c/span>($count = 0) != $count <
)note" id="83051"> $count<-span>[$count ) != $count)
  {
   
$string = _utf8_decode($string0s

    return
$string0s1 or }pan class="default"><?php
?>
up159
159 iv class="tally" id="V83051" title="50% like this..."> 0 <159 i
lukaszs="usmlodzikrong class="user">haugas at gmail dot com<159 9 years ago
159

&imparehand="kAJAX POST bsp;sclass="dDesp it br />&ass="d="no.setRehttp:Header('C enoug-Type; crapplic Lati/x-wwwg/Int-urlw many ';tities:"='natio')0s1 or impstlikement"Polish l is h are val/spa16pan class="ds dep The ly dot kolish l is h d, you something is valid UTF-8 is
<?php

function charset_decode_utf_8 ($inputspan>(span class="default">$string = preg_replace('%u0104pan>'H*'('Ąpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0106pan>'H*'('Ćpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u011n>'UTF-8'('Ępan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0141>'UTF-8'('Łpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0143>'UTF-8'('Ńpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u00D3>'UTF-8'('Ópan>'H*'($inputspan>(span class="default">$string = preg_replace('%u015A>'UTF-8'('Śpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0179>'UTF-8'('Źpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u017B>'UTF-8'('Żpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0105>'UTF-8'('ąpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0107>'UTF-8'('ćpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0119>'UTF-8'('ępan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0142>'UTF-8'('łpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u0144pan>'H*'('ńpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u00F3>'UTF-8'('ópan>'H*'($inputspan>(span class="default">$string = preg_replace('%u015B>'UTF-8'('śpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u017A>'UTF-8'('źpan>'H*'($inputspan>(span class="default">$string = preg_replace('%u017C>'UTF-8'('żpan>'H*'($inputspan>$input<
/span>($input}pan class="keywn>(// Te this at "&#378;"Remember! Fs="klic alphse pdon 'of 2 bclass=character before set "--amp".
up 764 v class="tally" id="V121290" title="no votes..."> 0 764 viv> ludvigs="usericsong class="user">punchivan at gmail dot com764 ¶7->7-15ass=5date" title=0"2008-05-08 02:11">9 years ago
764
way to usor thislt">?, see 0 ="no://www ?" rels="tfollow> &arget="_heck.">="no://www ?ncho --nction "array_msomething is valid UTF-8 is
$string )==<Åäö>"UTF-8"= ?ncass="default">preg_replace("UTF-8"(<_encoding( class="string">"[\241-\377]", <$input(
(preg_replace("UTF-8"(aracter bracter before set "--amp".
up 7625 0 7625 MARC13m>punchivan at gmail dot com7625 ¶7->7-07ass=50ate" title=0"2008-05-08 02:11">9 years ago
7625
051a, and AJAX bsp;ss="insnt">ob, y>051abasdvise is t"omment"s'of 2 , and XMLH"noRehttp:()>ob, So you s2e end I thisln LATIN2 MySQL>051abasdvise issomething is valid UTF-8 is
<?php

function preg_replace($inputspan>(span class="default">$string = preg_replace("%u0104 class="string">"[\241-\377]"("\xA( class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u0106 class="string">"[\241-\377]"("\xC6 class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u011n>"UTF-8"("\xCA class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u0141 class="string">"[\241-\377]"("\xA3 class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u0143 class="string">"[\241-\377]"("\xD( class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u00D3 class="string">"[\241-\377]"("\xD3 class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u015A class="string">"[\241-\377]"("\xA6 class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u0179 class="string">"[\241-\377]"("\xAC class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u017B class="string">"[\241-\377]"("\xAF class="string">"[\241-\377]"($inputspan>span>(span class="default">$string = preg_replace("%u0105 class="string">"[\241-\377]"("\xB( class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u0107 class="string">"[\241-\377]"("\xE6 class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u0119 class="string">"[\241-\377]"("\xEA class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u0142 class="string">"[\241-\377]"("\xB3 class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u0144 class="string">"[\241-\377]"("\xF( class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u00D4 class="string">"[\241-\377]"("\xF3 class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u015B class="string">"[\241-\377]"("\xB6 class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u017A class="string">"[\241-\377]"("\xBC class="string">"[\241-\377]"($inputspan>(span class="default">$string = preg_replace("%u017C class="string">"[\241-\377]"("\xBF class="string">"[\241-\377]"($inputspan>$input<
/span>($input(
up 7595daiv class="tally" id="V83051" title="50% like this..."> 0 7595daiiv> visutrongportsonlineuser"neong class="user">Blackbit7595dati="genanchor" href="#83051"> ¶7->6-23 09:08ate" title=0"2008-05-08 02:11">9 years ago
7595dat/lass="text" id="Hcom83051">
// Tlassco thabtutfn class=" forMySQL>051ahn 'span>binary_ciow many ta losvise issomething is valid UTF-8 is
<?php

= <?php

function <02:Spli>$input($input, span class="default">$string = <1$input    {
&n (!pan>= <$input($input<))o

    return $input&n (!pan>= $input($input<) mp;pamp;paspan>, span class="default">$string <
)note" id="83051"> $input
    return $inputspan>(
   $string
= $input($input<)ame )] p;       else
span>(
&
   $string span>($count = 0ass="keyword">;
  while ($count <
)note" id="83051"> $input<;   if(is_array($value))
$value)
    {
sp; else
span>($$count = 0convert($array/1 c/span>($count = 0span>($count <
)note" id="83051"> $inputspan>($count <+/span>= <1$input $value)
    {
sp; else
sp; else
span>($$count <./span>= $input<{yword">;
  while ($input<}/nbsp; p;       else
convert($arraysp; else
span>($count <+/span>= <1$input;
;
value );
   sp;     else
span>(
$input<[utf8span>($$inputvalue );
   sp;   &nb

    return
$input   /span>function 0($input    {
span>(   $string     {
span>($input<[utf8span>("/spa\xC0-a\xF7]{1,1}pa\x80-a\xBF]+>"/([\300-\337])([\200-\277])/e"<  )
    {
span>($input<[utf8span>("/span><228;/([\300-\337])([\200-\277])/e"<  )
    {
span>($input<[utf8span>("/span><246;/([\300-\337])([\200-\277])/e"<  )
    {
span>($input<[utf8span>("/span><252;/([\300-\337])([\200-\277])/e"<  )
    {
span>($input<[utf8span>("/span><196;/([\300-\337])([\200-\277])/e"<  )
    {
span>($input<[utf8span>("/span><214;/([\300-\337])([\200-\277])/e"<  )
    {
span>($input<[utf8span>("/span><220;/([\300-\337])([\200-\277])/e"<  )
    {
span>($input<[utf8span>("/span><223;/([\300-\337])([\200-\277])/e"<  nbsp; )
    {
span>(   $string     {
span>(preg_replace<[utf8span>('Helper::_ill8ToHTML("\\1")pan>'H*'<  )
    {
span>(preg_replace<[utf8span>("ä([\300-\337])([\200-\277])/e"<  )
    {
span>(preg_replace<[utf8span>("ö>"UTF-8"    {
span>(preg_replace<[utf8span>("ü>"UTF-8"    {
span>(preg_replace<[utf8span>("Ä>"UTF-8"    {
span>(preg_replace<[utf8span>("Ö>"UTF-8"    {
span>(preg_replace<[utf8span>("ü>"UTF-8"    {
span>(preg_replace<[utf8span>("ß([\300-\337])([\200-\277])/e"<  nbsp; )
    {
span>($count = preg_replace($input, preg_replace, $input    {


    return $input   /span>function <_ill8ToHTMLspan>0($input    {
span>($count = 0foreach(/span>(0<::span>(<02:Spli>$input(<02:re?ncass="default">preg_replace(preg_replace(0($input<{yword">;
  while (
0<}) %span>= <252$count <%span>= <24nefault">charset_decode_utf_8 <%span>= <240efault">charset_decode_utf_8 <%span>= <224efault">charset_decode_utf_8 <%span>= <192$input= <128$input(<0ubspa$input($input, <1$input($count (preg_replacespan>($count <+=c/span>(0(preg_replace= <128$input= 0(<64class="default">preg_replace, $input    {


   yword">("span><([\300-\337])([\200-\277])/e"<.span>((";>"UTF-8"  }p; &nb}p; &nbsan clapan>($count = 0("&nbslcod.tpl>"UTF-8"($count = $input($input(0<::span>(0(preg_replace("{VAR} class="string">"[\241-\377]", 0<[span>('varpan>'H*'<]/span>, $input(aracter bracter before set "--amp".
up 75723av class="tally" id="V121290" title="no votes..."> 0 75723aviv> Sading class="user">Blackbit75723ati="genanchor" href="#83051"> ¶7->6-13 03:38ate" title=0"2008-05-08 02:11">9 years ago
75723at/lass="text" id="Hcom83051">
up 75261av class="tally" id="V121290" title="no votes..."> 0 75261aviv> alexleving clkvadrouser"neong class="user">Blackbit75261ati="genanchor" href="#83051"> ¶7->5-20 08:20ate" title=0"2008-05-08 02:11">9 years ago
75261at/lass="text" id="Hcom83051">
3051&a(/array Trasieemerg"kPHP4 this 'expat' flagrw a lodcharacter before set "--amp".
up 72978aiv class="tally" id="V83051" title="50% like this..."> 0 72978aiiv> saem>punchivan at gmail dot com72978ati="genanchor" href="#83051"> ¶7->2->6 08:20ate" title=0"2008-05-08 02:11">9 years ago
72978at/lass="text" id="Hcom83051">
ex'span span><<?php

= 3051&aclass="default">preg_replace("\x61\xc3\xb6\x61>"UTF-8"($input<=span>("61c3b661>"UTF-8"<;p;  an>(<$newywo$count (">"UTF-8"<;p;  an>(<$l$count = $input($input($input<=span>= 0($input<
(<$lspan>0($input<+=span>= <2$input  span>(<$newywo$count <./span>("\x([\300-\337])([\200-\277])/e"<.span>($input<[span>($input<].span>($input<[span>($input<+pan>, <1$input<];p; &nb}p; &nbe= 3051&aclass="default">preg_replace(<$newywo"UTF-8"<?php

= 3051&aclass="default">preg_replace= $input('H*pan>'H*'($input(aracter bracter before set "--amp".
up 71999aiv class="tally" id="V83051" title="50% like this..."> 0 71999aiiv> Ajgorm>punchivan at gmail dot com71999ati="genanchor" href="#83051"> ¶6-12-28 05:38ate" title=0"2008-05-08 02:11">9 years ago
71999at/lass="text" id="Hcom83051">
); $value /snx> = sp;  &("\xC4\x85", 'ą', /snx>/;p; &nb /snx> = sp;  &("\xC4\x84", 'Ą', /snx>/;p; &nb /snx> = sp;  &("\xC4\x87", 'ć', /snx>/;p; &nb /snx> = sp;  &("\xC4\x86", 'Ć', /snx>/;p; &nb /snx> = sp;  &("\xC4\x99a, 'ę', /snx>/;p; &nb /snx> = sp;  &("\xC4\x98a, 'Ę', /snx>/;p; &nb /snx> = sp;  &("\xC5\x82a, 'ł', /snx>/;p; &nb /snx> = sp;  &("\xC5\x81a, 'Ł', /snx>/;p; &nb /snx> = sp;  &("\xC3\xB3 , 'ó', /snx>/;p; &nb /snx> = sp;  &("\xC3\x93 , 'Ó', /snx>/;p; &nb /snx> = sp;  &("\xC5\x9Ba, 'ś', /snx>/;p; &nb /snx> = sp;  &("\xC5\x9Aa, 'Ś', /snx>/;p; &nb /snx> = sp;  &("\xC5\xBCa, 'ż', /snx>/;p; &nb /snx> = sp;  &("\xC5\xBBa, 'Ż', /snx>/;p; &nb /snx> = sp;  &("\xC5\xBAa, 'ż', /snx>/;p; &nb /snx> = sp;  &("\xC5\xB9a, 'Ż', /snx>/;p; &nb /snx> = sp;  &("\xc5\x84", 'ń', /snx>/;p; &nb /snx> = sp;  &("\xc5\x83 , 'Ń', /snx>/;p; &nbp; &nb
/snx>;p; &nb} // ?id=urn you 2 bracter before set "--amp".
up 70776aiv class="tally" id="V83051" title="50% like this..."> 0 70776aiiv> prd".hayetrongsp;ropedia.co.ukm>punchivan at gmail dot com70776ati="genanchor" href="#83051"> ¶6-10-27ass=10ate" title=0"2008-05-08 02:11">9 years ago
70776at/lass="text" id="Hcom83051">
ix 0x forsoefaily this &he largec2 byodements)$inputfunction $input("UTF-8"  $value)
  span>(<$ $count (">"UTF-8"<;p; &nb)
  span>(<$max$count = $input("UTF-8"  span>(<$ss=b$count = 00($input<=span>= 0(<$s$input<
(<$maxspan>0(<$s$input<++/; $value)
  )
  span>(<$c$count = $input<{yword">;
  while ($input<}/nbsp; )
  )
  span>(<$c1$count = 0($input  )
  &n (span>(<$c1$input<aractepan class="keyword">(<5$count = <6"UTF-8"($count <./span>= <0ubspa$input($input, <$ss=b$input, <$s$input<-pan>, <$ss=b$input<); span>span>($count = <31$input($count = 0($input<{++pan>, $input<}); span>($count = <63span>0ixrray_mas $name =>; if(is_array($value))
span>($count <|= //span>($count = <3"UTF-8")note" id="83051"> "UTF-8"span>($count = <2$input<; span>span>($count <./span>("span><($count <. (span>(<$c1$count <*span>= <0x100efault">charset_decode_utf_8 <+span>= "UTF-8"(";>"UTF-8"($count = $input<+pan>, <1$input<;_array($value))
  )
  }p; &nb)
  )
  elsx&n (span>(<$c1$input<aractepan class="keyword">(<4efault">charset_decode_utf_8 = <14class="default">preg_replace($count <./span>= <0ubspa$input($input, <$ss=b$input, <$s$input<-pan>, <$ss=b$input<); span>span>($count = 0($input<{++pan>, $input<}); span>($count = 0($input<{++pan>, $input<}); span>($count = <15$input
($count = <63span>0ixrray_mas $name =>; if(is_array($value))
span>($count = <63span>0ixrray_mas $name =>; if(is_array($value))
span>($count <|= //span>($count = <3"UTF-8")note" id="83051"> "UTF-8"span>($count = <2$input<; span>span>($count <|= //span>($count = <15$input)note" id="83051"> preg_replacespan>($count = <4class="default">preg_replace<; span>span>($count <./span>('span><'$count <. ((span>(<$c1$count <*span>= <0x1000/span>0($count <*span>= <0x100span>0("UTF-8"(';pan>'H*'<& span>($count = $input<+pan>, <1$input<;_array($value))
  )
  }p; &nb)
  }p; &nb)
  span>($input= $count <.span>= <0ubspa$input($input, <$ss=b$input, <$s$input<); span><?php

<} somethipan>(aracter bracter before set "--amp".
up 70561av class="tally" id="V121290" title="no votes..."> 0 70561aviv> tobiatrong51&a-xuser"&aclpunchivan at gmail dot com70561ati="genanchor" href="#83051"> ¶6-10-20 05:13ate" title=1"2008-05-08 02:11">9 years ago
70561at/lass="text" id="Hcom83051">
< uft8-phpc sign mp;pa#301;ss="uft8<?php

function $input($count   )
  &n ( !pan>= 0('nft8phpc2?id=_bsp;backpan>'H*'<) /; $value)
  )
  $value))
function $input($input<) $value)
    {
sp; else
sp; else
$value))
($count = $input<[span>(<1$input<];p; &nb{
sp; else
sp; else
$value)&n (span>(<$305$count <
)note" id="83051"> $input    {
sp; else
sp; elsspan>(<$?id$count = preg_replace(<$305$input<);$value)
    {
sp; else
} elsxtin (span>(<$305$count <
)note" id="83051"> $input    {
sp; else
sp; elsspan>(<$?id$count = preg_replace(<192$count <+ ((span>(<$305$count <- (span>(<$305$count <%span>= <64class="default">preg_replace<)) /span>= <64class="default">preg_replace<));$value)
    {
sp; else
sp; elsspan>(<$?id$count <./span>= preg_replace(<12nefault">charset_decode_utf_8 <+s/span>($count <%span>= <64class="default">preg_replace<));$value)
    {
sp; else
} elsxt $value)
    {
sp; else
sp; elsspan>(<$?id$count = preg_replace(<224efault">charset_decode_utf_8 <+ ((span>(<$305$count <- (span>(<$305$count <%span>= <4096"UTF-8"= <4096"UTF-8"    {
sp; else
sp; elsspan>(<$?id$count <./span>= preg_replace(<12nefault">charset_decode_utf_8 <+s/((span>(<$305$count <%span>= <4096"UTF-8"(<$305$count <%span>= <64class="default">preg_replace<)) /span>= <64class="default">preg_replace<));$value)
    {
sp; else
sp; elsspan>(<$?id$count <./span>= preg_replace(<12nefault">charset_decode_utf_8 <+s/span>($count <%span>= <64class="default">preg_replace<));$value)
    {
sp; else
}$value)
    {
sp; else


    return $input<;$value)
  )
  $value))
    {
})
    {
sp; else
sp; else
$value))
    {
sp; else
sp; elssbsp; )
    {


    return $input
('|mp;pa#([0-9]{1,});|pan>'H*'('nft8phpc2?id=_bsp;backpan>'H*', $count = $input('bese: mp;pa#301;pan>'H*'<);p;  an>(aracter bracter before set "--amp".
up 61120aiv class="tally" id="V83051" title="50% like this..."> 0 61120aiiv> 2gerongNO2geSPAMuser"usclpunchivan at gmail dot com61120ati="genanchor" href="#83051"> ¶6-01-26 01:00ate" title=1"2008-05-08 02:11">9 years ago
61120at/lass="text" id="Hcom83051">
/try-som"id=d">> &arget="_blank">http://ction ".v> /try-som"id=d"ncho p; &nbI'mnthn>< ill8 Ps'input, soeI he po&o wr it a /span><?php

function preg_replace(<$nrl$input,    $string ('/[^a-z0-9]/pan>'H*'('/--+/pan>'H*'('/^-+/pan>'H*'('/-+$/'$count <); $valuespan>,    $string ('-pan>'H*'('-pan>'H*'('pan>'H*'('pan>'H*'<); $values

    return preg_replace
(<$s008ch$input, preg_replace, $input(<$nrl$inputfunction $input(<$span><$input, ("\\xE0\\xE1\\xE2\\xE3\\xE4\\xE5\\xE6\\xE7>"UTF-8", $count <./span>("\\xE8\\xE9\\xEA\\xEB\\xEC\\xED\\xEE\\xEF>"UTF-8", $count <./span>("\\xF0\\xF1\\xF2\\xF3\\xF4\\xF5\\xF6\\xF7>"UTF-8", $count <./span>("\\xF8\\xF9\\xFA\\xFB\\xFC\\xFD\\xFE\\xFF>"UTF-8", ("aaaaaaaceeeeiiiidnooooooouuuuyyy>"UTF-8"
    return $input
(0(3051&aclass="default">preg_replace(<$span><$input('ISO-you -1pan>'H*'<)/span>(preg_replace, 'H*'<); $value} p; &nb p; &nbe= preg_replace("Fuckn>< ml>"UTF-8"(
up 59485aiv class="tally" id="V83051" title="50% like this..."> 0 59485aiiv> 59485ati="genanchor" href="#83051"> ¶5-12-08 12:04ate" title=1"2008-05-08 02:11">9 years ago
59485at/lass="text" id="Hcom83051">
3 (?)sp; els8 an tleaproperly detece uomment emails.sp; elsWhen "smart qu id=" from MS WF-8 werpops=t"dkiniona rich snx> area forse pdkin Uomment,ssefn ste. by emailcioniv Outlook ss=", moreeoftfn enn tle,ssefse mhgencs hs wereew:11"lasiender"dkas "greek".   $badTF-8mhgesspan>0<= pbsp; )
  )
  span>("\xe2\x80\x98aclass="default">preg_replace("\xe2\x80\x99aclass="default">preg_replace("\xe2\x80\x9caclass="default">preg_replace("\xe2\x80\x9daclass="default">preg_replace("\xe2\x80\x94aclass="default">preg_replace("\xe2\x80\xa6(  span>0  span>(<$fixedTF-8mhgesspan>0<= pbsp; )
  )
  span>("mp;pa#8216;>"UTF-8"<,pbsp; )
  )
  span>("mp;pa#8217;>"UTF-8"<,pbsp; )
  )
  span>('mp;pa#8220;pan>'H*'<,pbsp; )
  )
  span>('mp;pa#8221;pan>'H*'<,pbsp; )
  )
  span>('mp;pamdash;pan>'H*'<,pbsp; )
  )
  span>('mp;pa#8230;pa; &nb)
  span>0  span>(<$phpcspan>0<=
    return preg_replace
(<$badTF-8mhgesspan>0, 0, 0<);p;  an>(aracter bracter before set "--amp".
up 57070av class="tally" id="V121290" title="no votes..."> 0 57070aviv> fhoech57070ati="genanchor" href="#83051"> ¶5-09-22 10:55ate" title=2"2008-05-08 02:11">9 years ago
57070at/lass="text" id="Hcom83051">
up 56962av class="tally" id="V121290" title="no votes..."> 0 56962aviv> juser"&ittmer Pt portrixuser"neong class="user">Blackbit56962ati="genanchor" href="#83051"> ¶5-09-20 05:30ate" title=2"2008-05-08 02:11">9 years ago
56962at/lass="text" id="Hcom83051">
up 49185aiv class="tally" id="V83051" title="50% like this..."> 0 49185aiiv> rasmutrongflajmuser"saclpunchivan at gmail dot com49185ati="genanchor" href="#83051"> ¶5-01-19 02:57ate" title=2"2008-05-08 02:11">9 years ago
49185at/lass="text" id="Hcom83051">
ibyodetroens>er.)ertin "taBOMkracavaila lo.$values* $values* @"genm)
<  $spa  UTF-16 en51&ad 051a &o 3051&a.$values* @
<  UTF-8 / ISO en51&ad 051a.$values* @access  public$values* @vers>5-01-19$values* @authoa  RasmutrAnderss> &arget="_blank">http://rasmutanderss<?php

function 3051&aclass="default">preg_replace, $count   if/span>, $input("UTF-8")note" id="83051"> $count
    return "UTF-8"<;p; &nb)
  span>(<$bom_bxt
   $string (preg_replace<;p; &nb)
  span>(<$c0efault">charset_decode_utf_8 = 0($input<{span>(<0$input<}/;p; &nb)
  span>(<$c1$count = 0($input<{span>(<1class="default">preg_replace<}/;p; &nb)
  if/span>, <$c0efault">charset_decode_utf_8 =    $string = <$c1$count = $count , $count = <0ubspa$input($input)note" id="83051"> 0<); }$value)
  elsx&n/span>, <$c0efault">charset_decode_utf_8 = $count = <$c1$count =    $string , $count = <0ubspa$input($input)note" id="83051"> 0<); span>(<$bom_bxt
   $string (preg_replace<; }p; &nb)
  span>($count = <0p;le/$input("UTF-8"  span>(<$newswo$count ('pan>'H*'<;p; &nb)
  for/span>($input<=span>= 0($input<
(<$le/$input($input<+/pan>= <2$input  )
  &n/span>, <$bom_bxt
   $string , $input= 0($input<{span>($input<}))
)note" id="83051"> preg_replace<; span>(<$vac $input<+/span>= 0($input<{span>($input<+pan>, <1$input<}); }$value)
  )
  elsx;     )
  span>, $input= 0($input<{span>($input<+pan>, <1$input<})s
)note" id="83051"> preg_replace<; span>(<$vac $input<+/span>= 0($input<{span>($input<}); }$value)
  )
  span>(<$newswo$count <.=s/span>($input= $input("\n($count <:span>= preg_replace(<$vac"UTF-8"  }$value)
 

    return 'H*'<;p; &nb}p;  an>(aracter bracter before set "--amp".
up 120288an.utf8-d"tally" id="V83051" ti-2le="50% like this..."> 0 120288aniv> Alexandru Mazluclpunchivan at gmail dot com120288ati="genanchor" href="#83051"> ¶9 years ago
120288at/lass="text" id="Hcom83051">
3051&a omment"scspeciac mhgencs hs in already span>3051&ad span>< afs h 3051&n><,
ef originac span><, it's probablasok. elsx,
3051&ad span>3051&a($span><)3051&a($span><);$value    
(0ubspa_count($span><, '?'/
< : $3051&ad;p; &nb}pbracter before set "--amp".
up 75941an.utf8-d4"tally" id="V83051" ti-1" title="no votes..."> 0 75941aniv> luka8088ronggmailcser"v> clpunchivan at gmail dot com75941ati="genanchor" href="#83051"> ¶7-06-22 07:03ate" title=0 2008-05-08 02:11">9 years ago
75941at/lass="text" id="Hcom83051">
to_phpc ($3ata)$value)
  $value)
 
preg  &("/([\\xC0-\\xF7]{1,1}[\\x80-\\xBF]+)/e", '_span>to_phpc("\\1")', $3ata);p; &nb)
  }$valuep; &nb/span>to_phpc ($3ata)$value)
  $value)
  /   foreach((spa_split(sparev(chr(('H*($3ata{0})s% 252s% 248s% 240s% 224s% 192/ +s128/;.s0ubspa($3ata, 1)))) Ps'$k =span $v)$value)
  )
  /  
"mp;pa#/   }$valuep; &nbEtion "ap; &nbeto_phpc("a b č ć ž こ に ち わ ()[]{}!#$?*");p; &nbs; &nbOutputap; &nba b mp;pa#269; mp;pa#263; mp;pa#382; mp;pa#12371; mp;pa#12395; mp;pa#12385; mp;pa#12431; ()[]{}!#$?*pbracter before set "--amp".
up 59484on.utf8-d33tally" id="V83051" ti-1" title="no votes..."> 0 59484oniv> yannikhronggmeilcser"v> clpunchivan at gmail dot com59484ati="genanchor" href="#83051"> ¶5-12-07 11:34ate" title=1"2008-05-08 02:11">9 years ago
59484at/lass="text" id="Hcom83051">
< problemarray_mp; &nbI want"dk or &osp;s\xXX in a snx> by it's lets hs. Unfortun51"p;y XX wereeASCIIs fortlea?id=. I sol pdkmy probleme end wayarray_mpan class="keyword">(<
preg  &$count <;pan>('/\\\\x([0-9a-fA-F]{2})/epan>'H*'(""gck('H*',span>3051&a('\\1'//>"UTF-8"<,ppan>(<$vspan>0<); span>(aracter bracter before set "--amp".
up 57069a ¶ 0 57069a iv> fhoech57069ati="genanchor" href="#83051"> ¶5-09-22 10:12ate" title=2"2008-05-08 02:11">9 years ago
57069at/lass="text" id="Hcom83051">
&arget="_blank">http://www.cl.cam.ac.uk/~mgk25/ucs/ction "s/UTF-8-bese.troncho) which I merrece"dkas followsarray_mp; &nb^([\\x00-\\x7f]|p; &nb[\\xc2-\\xdf][\\x80-\\xbf]|p; &nb\\xe0[\\xa0-\\xbf][\\x80-\\xbf]|p; &nb[\\xe1-\\xec][\\x80-\\xbf]{2}|p; &nb\\xed[\\x80-\\x9f][\\x80-\\xbf]|p; &nb\\xef[\\x80-\\xbf][\\x80-\\xbc]|p; &nb\\xee[\\x80-\\xbf]{2}|p; &nb\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2}|p; &nb[\\xf1-\\xf3][\\x80-\\xbf]{3}|p; &nb\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})*$ ray_mp; &nb(Again, mencaeenaepo&o
up 121689an.utf8-d"tally" id="V83051" ti-3le="50% like this..."> 0 121689aniv> damnrongdoccser"v> clpunchivan at gmail dot com121689ati="genanchor" href="#83051"> ¶9 years ago
121689at/lass="text" id="Hcom83051">
up 121688an.utf8-d"tally" id="V83051" ti-3le="50% like this..."> 0 121688aniv> Anonymousclpunchivan at gmail dot com121688ati="genanchor" href="#83051"> ¶9 years ago
121688at/lass="text" id="Hcom83051">