1

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.

Karuvägistaja
  • 293
  • 1
  • 8
  • 17
  • 1
    Can you show how you're outputting the said French characters (with an example)? – Amal Murali Nov 03 '13 at 20:34
  • 1
    have you set the right encoding value? utf-8 – Ulrich Horus Nov 03 '13 at 20:36
  • Added the example and encoding type. – Karuvägistaja Nov 03 '13 at 20:42
  • 1
    Obligatory read: [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)](http://www.joelonsoftware.com/articles/Unicode.html). Your GET parameter is encoded in UTF-8, but your page uses ISO 8859-1. You should really consider switching to UTF-8, everywhere. – Marcel Korpel Nov 03 '13 at 21:00

1 Answers1

2

Maybe use UTF-8 without BOM encoding?

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

... in PHP and:

<meta charset="utf-8">

... in HTML.