Re: First stupid post of the year. [SOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 &nbsp;

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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux