Joel CARNAT wrote:
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 ;)

I meant get parameters to google:

http://www.google.com/search?q=help&ie=utf-8&oe=utf-8

you need to change ie parameter ----^^ to whatever encoding you are using.

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



Reply via email to