Detailed answer
Put meta charset=utf-8 early in head and save the file using UTF-8.
The declaration tells a reader how to interpret bytes; it cannot repair text saved in the wrong encoding. If characters still break, check response headers and the stages that generated or stored the text.
Example
<head><meta charset="utf-8"><title>नमस्ते HTML</title></head>
Understanding the behavior
The HTML encoding declaration should appear early, within the first 1024 bytes, and agree with how the file is saved. An HTTP Content-Type charset can also affect decoding, so inspect server headers when a correct-looking meta tag does not solve garbled text.
Practical implementation notes
Save a small test containing non-ASCII characters as UTF-8 and reload it. Re-saving already corrupted text in UTF-8 preserves the corruption; recover the original characters before changing the encoding.
How to check it
Check the saved bytes and response charset as well as the declaration.
Expected result
Encoding agrees across the file and response instead of relying on the tag alone.
Watch out: Changing the tag does not convert the encoding of an existing file.
Read the reference ↗