tags:

views:

26

answers:

2

When my URL contains a get with "בלה בלה" , the url stays in hebrew and when I do echo $_GET['hebrew'], it outputs it in hebrew, great. However, when it contains "São Paulo", it starts going nuts, the URL changes to "S%E3o%20Paulo" and the output is "S�o Paulo".

This gets me extremely frustrated, can anyone of you guys help me with this??

A: 

The only safe thing to do is to create URL's that have %xx for the UTF-8, not non-ASCII characters. If you do otherwise, your mileage will vary all over the place. The process of turning a byte sequence into one with %xx escapes is called URL-encoding. You'll need a PHP expert to tell you how to do that there.

bmargulies
How do i do that then?
sombe
Unfortunately, PHP I can't help you with. What I know is what's safe to send around on the wire.
bmargulies
A: 

You can encode your URLs using urlencode, which a browser usually does for you, but as @bmargulies mentions your mileage may vary with different character sets if you don't encode your URLs.

http://php.net/urlencode

Kristopher Ives