Karuvägistaja
Karuvägistaja

Reputation: 293

"GET" method encoding French characters incorrectly in PHP

I have a site that uses get method to get the parameters from URL. The URL has French characters is it and by using get method the characters get ruined. How can I use get method without encoding problems from French language?

The characters are written in URL this way: "http://domain.com/wt.php?id=Thor-:-Le-Monde-des-t%C3%A9n%C3%A8bres"

Then The browser URL bar encodes them correctly but the get method does not. The page itself is using "iso-8859-1" encoding.

Upvotes: 1

Views: 838

Answers (1)

user2518044
user2518044

Reputation:

Maybe use UTF-8 without BOM encoding?

header('Content-type: text/html; charset=utf-8');

... in PHP and:

<meta charset="utf-8">

... in HTML.

Upvotes: 2

Related Questions