Re: Re: [PHP] urlencode and google search query
| From: | Joel CARNAT | Date: | Wed, 27 Oct 2004 22:26:26 +0000 |
| Subject: | Re: Re: [PHP] urlencode and google search query | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200487@lists.php.net to get a copy of this message | ||
On Wed, Oct 27 2004 - 23:41, Marek Kilimajer wrote:
> >how comes urlencode generates "%E9" and google generates "%C3%A9" ?
> >is google using some specific encoding ? any tweak to encode "the google
> >way" ?
>
> you can specify your encoding to google using "ie" parameter. and output
hum... I don't get what you mean :(
there is no parameter to the urlencode php function, isn't it ?
> encoding with "oe". google usualy uses UTF-8, that's why some single
> characters are encoded in two bytes.
I tried :
echo "<html><meta http-equiv=\"refresh\" content=\"0;url=http://www.google.fr/search?q=".utf8_encode($query)."\"></html>";
which acts the same, aka "%E9"
and
$query = utf8_encode($_POST["query"]);
which is worse than ever :)
it produces : %20t%C3%83%C6%92%C3%82%C2%A9 %-)
can you clarify what you mean when you say "use the ie param" and "encoding with
oe".
sorry if those questions seems sily, but I'm not a heavy php coder ;)
TIA,
Jo
--
,-- This mail runs ---------.
`-------- OpenBSD/sparc64 --'