• Register
0 votes
1.5k views

Problem :

I am very confused about an error message I'm getting when I try to validate any simple HTML document without the meta encoding like this:

<!DOCTYPE html>

<html>

<head>

<title>MyTest</title>

</head>

<body>MyTest</body>

</html>

The W3C validator http://validator.w3.org reluctantly accepts a document as valid with just a few warnings when it is pasted into a direct input form, but when the document is uploaded or loaded by the URI, validation fails with below error message

The character encoding was not declared. Proceeding using windows-1252.

There are two things I don't understand about above error:

· Why is the missing character encoding considered an error, when fallback rules exist?

· Why is a validator assuming windows-1252 instead of UTF-8, like any browser would?

Can someone explain me these two points please? I am pretty new to this stuff, so please bear with me.

7 5 2
3,870 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

Well that depends on what you are using.

· if you are using a File Upload option, it depends on which encoding the HTML file was saved with.

· if you are using a Direct Input option, it depends on the navigator.

If you don't want a validator to guess, and use UTF-8, you can add the following line

<meta charset="UTF-8">

inside a  head element.

Hope it solves your issue.

9 7 4
38,600 points

Related questions

0 votes
0 answers 23 views
23 views
Problem : I am very confused about an error message, any help: Error: the character encoding was not declared. proceeding using windows-1252 .
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 28 views
28 views
Problem: The character encoding of the html document was not declared
asked Feb 16 Ethan ross 2.7k points
0 votes
1 answer 13 views
13 views
the character encoding of the html document was not declared.
asked Feb 16 ArifulIslam 7.5k points
0 votes
1 answer 1 view
1 view
Problem: Why I got this error:error unmappable character for encoding utf 8?
asked Apr 4 ashik 12.9k points
0 votes
1 answer 3 views
3 views
Problem: Who can help me to figure it out:error unmappable character for encoding utf8?
asked Apr 4 ashik 12.9k points
0 votes
1 answer 3 views
3 views
Problem: This error have been addressed several times, but no answers helped me, cygwin g++ std::stoi "error: 'stoi' is not a member of 'std.
asked 4 days ago Moumita Bhowmick 1.5k points
0 votes
1 answer 4 views
4 views
Problem: Hello there! I am having a problem while working on my script.I cannot find any solution of this issue>error was not declared in this scope.Help me please.
asked Apr 4 ashik 12.9k points
0 votes
1 answer 3 views
3 views
Problem: I got a problem solving this error: &lsquo;cout&rsquo; was not declared in this scope.I need help from someone.
asked Apr 3 ashik 12.9k points
1 vote
1 answer 7 views
7 views
Problem: How to fix this error? Error: 'cout' was not declared in this scope.
asked Mar 28 PkGuy 13.1k points
0 votes
1 answer 64 views
64 views
Problem: I am working on functions in C++. I am facing the above mentioned error while I am trying to run the following program: #include <iostream> using namespace std; int main() { cout<<func(4); } int func(int number) { return number; } I have no idea about the error. Why this error is being triggered and how can I resolve this issue?
asked Nov 10, 2020 Code Learner 9.2k points