Missing charset header error - html

I have tried the following code. But still Charset header is missing, error is coming
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
I have used this line as well:
<meta charset="utf-8">...
but the error persists.

Try with removing / at the end of the meta tag.
Thanks.

Start your HTML-document like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Page Title</title>
</head>
...

I found a solution but it's not in META of page (I spent a few hours on this way), it's in server configuration, adding charset configuration in ngingx virtual server configuration
charset UTF-8;
I don't know about apache configuration but it should be very similar
try somethin like :
AddDefaultCharset utf-8
now I have a problem, while I type
curl -I www.w3sos.com (my testing environment)
I don't see the result, but when I use a web test solution like site analyzer it works ...
good luck, it was my 50 cents for this questions
greg

Related

How do I insert HTML boiler plate code in Visual Studio Code on Mac?

I started the coding journey and installed VSC suggested during a YouTube tut.
It seems that all emmet abbreviations are working except for SHIFT + ! which should give me the below.
<DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body>
</body>
</html>
Any ideas why this is?
I really appreciate any help you can provide.
I couldn't get VSCode to expand !+Tab, but I agree with you that it should have worked.
However, I've figured out that you can use html:5+Tab (or just ! with the Emmet: Expand Abbreviation command) to get a similar result.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>
You need to install HTML boilerplate extension from visual studio code extension.
I also use a Mac, I found this issue also when the file did not have a .html extension.
Try creating a new file with a .html extension such as index.html.
Retry the shift ! you did initially and press enter. The boilerplate should populate.

style.css not accepted by server

I set up my website locally on my hard disk, and everything works fine.
But when I upload my website to the server, the file "style.css" is not loaded.
When I look at code (F12), it gives me:
"style.css:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)".
The HTML file looks like this:
enter code here
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Child-Abduction.net</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="verify-v1" content="L0UzG/4pPu9fgnLL3FmaFIzGkaVSoAgVZ9LHzQ0yx0c=" />
<meta name="robots" content="index, follow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="favicon.ico" type="favicon/ico"/>
<link rel="stylesheet" href="style.css">
</head>
Any idea why "style.css" refuses to load on my website?
TIA
Found what was causing the "error".
Seemed that several other files were not accepted by the server although on my notebook everything worked fine.
For some reason, EVERYTHING that's uploaded to the server needs to be in "lower case".
Uploaded also some *.JPG files that were not accepted by the server until I changed them into *.jpg.
Thanks

Arabic text displays as question marks - firebase hosting

I'm setting up a page for terms with firebase hosting. I deployed the page but my text in page shows as question marks. my text is in Arabic language.
I tried many answers, but none of them work.
maybe the problem in firebase hosting?
I tried:
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256">
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-6">
My Code:
<!DOCTYPE html>
<html>
<meta charset="utf-8"/>
<body>
<h1 dir='rtl' lang='ar' >الشروط</h1>
<p dir="rtl" lang="ar">الشروط</p>
Code looks OK - just make sure your editor save it in UTF-8,
To verify this - download the file from the server as "yourfilename.html" and open it locally in your browser - see if you see it in Arabic.
If you don't, open it in notepad - you will probably see question marks which means you didn't save the file in UTF-8 format - you probably saved it as ASCII.
If on the other hand you will see it in Arabic - seek in the response structure you receive maybe something there is not right.

how to support Arabic language in html page?

I need to load HTML page from URL in my iOS app. The problem that the Arabic characters that are in this html page are shown as strange symbols.
I add <meta http-equiv="content-type" content="text/html;charset=utf-8"> but it dose not change.
Can anyone help me please?
Add unicode as your support in your html. try using the following in the head of html:
<meta charset="utf-8">
The Arabic characters should be included in utf-8 if I'm not mistaking. So your html should look something like this:
<!DOCTYPE html>
<html lang="ar">
<head>
<meta charset="utf-8">

marathi language not shown properly in browser

In my html document, I have my html as:
<html>
<head><title>title</title></head>
<body> <div>विजय कदम</div> </body>
</html>
I am getting output as:
विजय कदम
Any idea? what do I need to specify?
Save your file in UTF-8 encoding
Add meta tag to the html to support UTF-8
Make sure your server supports UTF-8 encoding, an example for Apache.
How to change the page encoding to UTF-8:
Add the following tag to the HTML:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Or the HTML5 equivalent:
<meta charset="utf-8" />
for more information about characters encoding check this out.
You need an editor that saves in Unicode UTF-8.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
you can also use a converter to display hindi. link: http://vikku.info/indian-language-unicode-converter/hindi-unicode-converter.html what you do is, you paste html text. Hope this helps!