HTML file with strange characters

User 2939500 Photo


Registered User
2 posts

Hello!
I have a program of my own that generates an HTML code, for a page of my website.
When I upload the generated HTML file to my website, it shows � instead of 'Ç', � instead of 'Ã'. So, it shows � for any international character (Ç, Ã, É, ç, ã, é, ê, í, etc).
But if I open the file in The HTML Editor and save the file, without changing anything, without touching enter key, or any other key, just click on Save icon and then upload the file again, it shows the international characters correctly.
<meta charset='utf-8'> is used in the <HEAD>.
What is wrong with the generated file?
Thank you
User 379556 Photo


Registered User
1,620 posts

Answers in https://stackoverflow.com/questions/322 … s-expected suggest to me that The HTML Editor may be correcting the coding to match the utf-8 setting in the head code.

Perhaps a comparison in a plain text editor of the code generated by your program with the code from The HTML Editor will shed some light on the matter. I use TextPad which includes a facitlity for such comparisons, but there are probably other plain text editors which will do the same sort of thing.

Frank
User 3210806 Photo


Guest
3 posts

This happens to me too — usually it’s an encoding mismatch. If your file isn’t properly set to UTF-8 (or the charset the browser expects), you’ll see weird characters. also, if the document type is old or mismatched, that can mess things up. I’d try changing the DOCTYPE to a simpler one (like <!DOCTYPE html>) and making sure you have <meta charset="utf-8"> in your <head>.

If after that it still shows weird symbols, it might be the way coffeecup is saving the file (e.g. without BOM) or inserting “smarts” from some editor feature. checking whether those characters are already in the file before upload vs after publishing might help narrow it down.
User 122279 Photo


Senior Advisor
14,669 posts

Have you tried to use the tool 'Search for undocumented characters? You find it in the 'Tools' menu.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.