|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-09-01 15:33 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 08:00:02 2025 UTC |
Description: ------------ my php.ini: ... mbstring.func_overload=6; mbstring.internal_encoding=UTF-8; mbstring.http_input = auto; mbstring.detect_order = ISO-8859-1,UTF-8; mbstring.encoding_translation = On; ... the internal encoding of php is utf-8. but somehow the $_SERVER vars do not seam to be utf-8 encoded. when you start to build an xml-soap request with including the httpUserAgent you get the following soap-client error. Code: Client Msg: SOAP-ERROR: Encoding: string 'xxxxxx' is not a valid utf-8 string using the dom-extension soapClient. this does not happen if you just put form-variables into the soap-request. so i started to debug the difference between a _SERVER var and a _REQUEST var. Reproduce code: --------------- Your http useragent name is: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Navegador IE6 de Grupo Cortefiel - T?cnica de Sistemas (c); SV1; .NET CLR 1.1.4322) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <form action="utf8.php" method="POST"> <input type="text" name="browser" size="40" /> </form> <pre> <?php print $_SERVER['HTTP_USER_AGENT']."\n"; print Strlen($_SERVER['HTTP_USER_AGENT'])."\n"; print strlen($_SERVER['HTTP_USER_AGENT'], 'iso-8859-1')."\n"; if (isset($_REQUEST['browser'])) { print $_REQUEST['browser']."\n"; print Strlen($_REQUEST['browser'])."\n"; print strlen($_REQUEST['browser'], 'iso-8859-1')."\n"; } ?> </pre> </body> </html> Expected result: ---------------- _SERVER VAR: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Navegador IE6 de Grupo Cortefiel - T?cnica de Sistemas (c); SV1; .NET CLR 1.1.4322) 135 136 _REQUEST VAR: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Navegador IE6 de Grupo Cortefiel - T?cnica de Sistemas (c); SV1; .NET CLR 1.1.4322) 135 136 Actual result: -------------- _SERVER VAR: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Navegador IE6 de Grupo Cortefiel - T?cnica de Sistemas (c); SV1; .NET CLR 1.1.4322) 133 135 _REQUEST VAR: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Navegador IE6 de Grupo Cortefiel - T?cnica de Sistemas (c); SV1; .NET CLR 1.1.4322) 135 136