Re: First stupid post of the year. [SOLVED]
| From: | Nisse Engström | Date: | Thu, 03 Jan 2008 15:24:46 +0000 |
| Subject: | Re: First stupid post of the year. [SOLVED] | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-266562@lists.php.net to get a copy of this message | ||
On Wed, 2 Jan 2008 19:36:56 -0500, tedd wrote:
> To find out, I did put the operation through FireFox and reversed the
> POST/GET operations to get a look at the string -- it is:
>
> %C2%A0%C2%A0%C2%A0Z%C2%A0%C2%A0%C2%A0 < where Z is the value passed.
>
> Now, C2 (HEX) is a linefeed (194 DEC)
>
> And, A0 (HEX) is a non-breaking space (160 DEC;) which is a
Not quite. <A0> is non-breaking space in *some* character
encodings, such as the ISO-8859-... encodings. It may
be different in other encodings. In UTF-8, it is <C2 A0>,
which is exactly what you're seing.
> Therefore, if I simply use:
>
> $submit = str_replace( chr(194), '', $submit );
> $submit = str_replace( chr(160), '', $submit );
>
> This is the solution.
Hardly.
> Now, why does a POST operation add in C2's? I'll leave that for
> another post. :-)
I haven't had time to look at the code, but perhaps you
need to specify a character encoding for the page.
/Nisse