emurb
emurb

Reputation: 147

Bad encoding when renaming html file to php

I had a file index.html with accents, and everything went fine. Since I changed it for index.php, I see encoding problems. So I replaced accent with HTML entities in index.php and it displays well. My last problem now is I have a form where inputs have custom placeholders fill in javascript, containing accents. Even with html entities these placeholders are displayed with encoding problem. How can I resolve this ? In my index.php I have :

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

And in firebug I have :

Content-Type    text/html; charset=iso-8859-1

Upvotes: 0

Views: 171

Answers (1)

bubak
bubak

Reputation: 11

When you're saving your file in text editor choose "Save As" usually you can choose encoding, for example in windows NotePad... in Sublime you can choose "Save with encoding" in PSPAD you have to click on Format and choose encoding before saving... Notepad++ i found this didn't checked it "In Notepad++ 5.9 there is an option in Settings -> Preferences -> New Document/Default Directory to automatically convert ANSI files to UTF-8 without BOM on open"

Upvotes: 1

Related Questions