blob: c7a7322e8fde5e05bbff8acb4dd45f1b96fb7c83 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2005, v.4002-->
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
"..\dtd\concept.dtd">
<concept id="cencoding" xml:lang="en-us">
<title>File Encoding</title>
<shortdesc></shortdesc>
<prolog><metadata>
<keywords><indexterm>character encoding<indexterm>location in files</indexterm></indexterm>
<indexterm>JSP files<indexterm>character encoding</indexterm></indexterm>
<indexterm>XHTML<indexterm>character encoding</indexterm></indexterm>
<indexterm>XML<indexterm>character encoding</indexterm></indexterm>
</keywords>
</metadata></prolog>
<conbody>
<p> The character encoding in XML, (X)HTML files, and JSP files can be specified
and invoked in many different ways; however, we recommend that you specify
the encoding in each one of your source files, for that is where many XML,
HTML, JSP editors expect to find the encoding.</p>
<p>For example, for JSP files, you might use the pageEncoding attribute and/or
the contentType attribute in the page directive, as shown in the following
example:<codeblock>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%&gt;
</codeblock></p>
<p>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: <codeblock>&lt;?xml version="1.0" encoding="iso-8859-1" ?></codeblock></p>
<p>For (X)HTML files, you might use the &lt;meta&gt; tag inside the &lt;head&gt;
tags, as shown in the following example:<codeblock>&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /></codeblock></p>
</conbody>
</concept>