Questions tagged [html-encode]

Anything related to encoding or decoding HTML entities.

Specifying the document's character encoding

There are several ways to specify which character encoding is used in the document. First, the web server can include the character encoding or charset in the Hypertext Transfer Protocol () Content-Type header, which would typically look like this:

Content-Type: text/html; charset=ISO-8859-1

This method gives the HTTP server a convenient way to alter document's encoding according to content negotiation; certain HTTP server software can do it, for example Apache with the module mod_charset_lite.

For HTML it is possible to include this information inside the head element near the top of the document:

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

also allows the following syntax to mean exactly the same:

<meta charset="utf-8">

Character encoding in HTML: http://en.wikipedia.org/wiki/Character_encodings_in_HTML

631 questions
-3
votes
1 answer

Should I save in db - user input as html encode?

We're having conflict with coworkers on whether we should htmlencode user input and then save it to db ( vs saving it straight forward as it is) I also found various answers which says that DB should save the plain(!) input. Why ? because DB should…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
1 2 3
42
43