Das Problem ist mir nur zu bekannt
Auszug aus einer meiner Klassen
PHP-Code:
/**
* @short Konvertiere String nach UTF-8
* @param [String] \b $i
* @param [String] \b $c Convertiere von Type utf-8 Standard
* @param [String] \b $s addslashes
* @return (String) \b $i (UTF-8)
* @protectedsection
*/
protected function sql_StringConvertToUtf8( $in, $c = 'utf-8', $s = true )
{
$a = array( "iso-8859-1", "iso-8859-15", "utf-8", "cp866", "cp1251", "cp1252", "koi8-r",
"big5", "gb2312", "big5-hkscs", "shift_jis", "euc-jp" );
$c = chop( $c );
$c = strtolower( $c );
if ( ! in_array( $c, $a, true ) )
return $in;
$in = stripslashes( $in );
$f = ( $c == 'utf-8' ) ? 'u' : '';
if ( preg_match( "/\&[#\d|\w]/$f", $in ) )
$in = html_entity_decode( $in, ENT_QUOTES, $c );
$str = utf8_encode( utf8_decode( $in ) );
if ( $str === $in )
$in = utf8_decode( $in );
else if ( strcasecmp( $str, $in ) )
$in = utf8_decode( $in );
$in = ( $s ) ? addslashes( $in ) : $in;
return utf8_encode( $in );
}
Danach ein htmlentities()
Lesezeichen