File encoding

You can specify and invoke the character encoding in XML files, XHTML and HTML files, and JSP files in different ways. Because many editors expect to find encoding in source files, specify the encoding in each one of your source files.

For JSP files, you might use the pageEncoding attribute, the contentType attribute, or both attributes in the page directive, as shown in the following example:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
For XML files, you might use the encoding pseudo-attribute in the xml declaration at the start of a document or the text declaration at the start of an entity, as in the following example:
<?xml version="1.0" encoding="iso-8859-1" ?>
For XHTML and HTML files, you might use the <meta> tag inside the <head> tags, as shown in the following example:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
Icon that indicates the type of topic Concept topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: cencoding.html