Robin
%Europe/Berlin %565 %2005, 13:34
Om een website meertalig te maken, sla ik teksten gecodeerd met html_entities op in een database. (via cms)
Op het moment dat ik deze teksten via AMFPHP ophaal moeten ze gedecodeerd worden.
In amfphp heb je de volgende opties:
setCharsetHandler(string mode, string phpCharset, string sqlCharset)
mode can be one of
- none don't do anything
- iconv uses the iconv libray for reencoding
- mbstring uses the mbstring library for reencoding
- recode uses the recode library for reencoding
- utf8_decode uses the XML function utf8_decode and encode for
reencoding - ISO-8859-1 only
phpCharset is the charset that the system assumes the PHP strings will be in.
sqlCharset is the charset of sql result sets used (only when outputting results
to flash client)
wsCharset (web service charset) has been eliminated from this release, UTF-8
is assumed as the remote encoding. When using PHP5 SoapClient, the SoapClient
object will be initialized with "encoding" => phpCharset. When using nusoap,
soapclient->soap_defencoding will be initialized with phpCharset.
The following settings are recommended (try the first setting appropriate for
your language, if it doesn't work try the second):
* English:
$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
* Western european languages (French, Spanish, German, etc.):
$gateway->setCharsetHandler( "iconv", "ISO-8859-1", "ISO-8859-1" );
$gateway->setCharsetHandler( "utf8_decode", "ISO-8859-1", "ISO-8859-1" );
* Eastern european languages (Russian and other slavic languages):
$gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );
$gateway->setCharsetHandler( "iconv", "your codepage", "your codepage" );
* Oriental languages (Chinese, japanese, korean):
$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
$gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );
* Other languages:
$gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );
$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
iconv is included by default in php5, but not in php4 although most
hosts have it installed. utf8_decode is of some use for Western European languages,
but please remember that it won't work with settings other than ISO-8859-1.
The other methods also require seldom-used extensions but were included
just in case your particular host only supports them.
De talen die ik nodig heb zijn o.a. italiaans, nederlands etc..
Dus dan kom je uit op :
$gateway->setCharsetHandler( "iconv", "ISO-8859-1", "ISO-8859-1" );
of
$gateway->setCharsetHandler( "utf8_decode", "ISO-8859-1", "ISO-8859-1" );
Als voorbeeld: Brazilië
In beide gevallen resulteert dit in : Brazilië
Weet iemand hoe ik ervoor kan zorgen dat dit goed weergegeven wordt?
Op het moment dat ik deze teksten via AMFPHP ophaal moeten ze gedecodeerd worden.
In amfphp heb je de volgende opties:
setCharsetHandler(string mode, string phpCharset, string sqlCharset)
mode can be one of
- none don't do anything
- iconv uses the iconv libray for reencoding
- mbstring uses the mbstring library for reencoding
- recode uses the recode library for reencoding
- utf8_decode uses the XML function utf8_decode and encode for
reencoding - ISO-8859-1 only
phpCharset is the charset that the system assumes the PHP strings will be in.
sqlCharset is the charset of sql result sets used (only when outputting results
to flash client)
wsCharset (web service charset) has been eliminated from this release, UTF-8
is assumed as the remote encoding. When using PHP5 SoapClient, the SoapClient
object will be initialized with "encoding" => phpCharset. When using nusoap,
soapclient->soap_defencoding will be initialized with phpCharset.
The following settings are recommended (try the first setting appropriate for
your language, if it doesn't work try the second):
* English:
$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
* Western european languages (French, Spanish, German, etc.):
$gateway->setCharsetHandler( "iconv", "ISO-8859-1", "ISO-8859-1" );
$gateway->setCharsetHandler( "utf8_decode", "ISO-8859-1", "ISO-8859-1" );
* Eastern european languages (Russian and other slavic languages):
$gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );
$gateway->setCharsetHandler( "iconv", "your codepage", "your codepage" );
* Oriental languages (Chinese, japanese, korean):
$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
$gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );
* Other languages:
$gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );
$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
iconv is included by default in php5, but not in php4 although most
hosts have it installed. utf8_decode is of some use for Western European languages,
but please remember that it won't work with settings other than ISO-8859-1.
The other methods also require seldom-used extensions but were included
just in case your particular host only supports them.
De talen die ik nodig heb zijn o.a. italiaans, nederlands etc..
Dus dan kom je uit op :
$gateway->setCharsetHandler( "iconv", "ISO-8859-1", "ISO-8859-1" );
of
$gateway->setCharsetHandler( "utf8_decode", "ISO-8859-1", "ISO-8859-1" );
Als voorbeeld: Brazilië
In beide gevallen resulteert dit in : Brazilië
Weet iemand hoe ik ervoor kan zorgen dat dit goed weergegeven wordt?