ID: 38681
Updated by: [EMAIL PROTECTED]
Reported By: bretschneider at cleverbridge dot com
-Status: Open
+Status: Bogus
Bug Type: *Unicode Issues
Operating System: Linux 2.6.12-1.1381_FC3
PHP Version: 5.1.6
New Comment:
_SERVER variables have nothing to do with mbstring extension, they
contain data from external sources, which PHP cannot affect.
Not PHP problem.
Previous Comments:
------------------------------------------------------------------------
[2006-09-01 14:31:59] bretschneider at cleverbridge dot com
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38681&edit=1