blob: 2ef446e75eaaa82982db215f505f27b0eff77bd7 [file] [log] [blame]
<!DOCTYPE html>
<html>
<!-- Created by Texinfo 6.8dev+dev, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual is for GNU Texinfo (version 6.8dev, 23 February 2022),
a documentation system that can produce both online information and a
printed manual from a single source using semantic markup.
Copyright (C) 1988, 1990-1993, 1995-1999, 2001-2022 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
<title>@documentencoding (GNU Texinfo 6.8dev)</title>
<meta name="description" content="@documentencoding (GNU Texinfo 6.8dev)">
<meta name="keywords" content="@documentencoding (GNU Texinfo 6.8dev)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2any">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Internationalization.html" rel="up" title="Internationalization">
<link href="_0040documentlanguage.html" rel="prev" title="@documentlanguage">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
-->
</style>
</head>
<body lang="en">
<div class="section-level-extent" id="g_t_0040documentencoding">
<div class="nav-panel">
<p>
Previous: <a href="_0040documentlanguage.html" accesskey="p" rel="prev"><code class="code">@documentlanguage <var class="var">ll</var>[_<var class="var">cc</var>]</code>: Set the Document Language</a>, Up: <a href="Internationalization.html" accesskey="u" rel="up">Internationalization</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="g_t_0040documentencoding-enc_003a-Set-Input-Encoding">14.2 <code class="code">@documentencoding <var class="var">enc</var></code>: Set Input Encoding</h3>
<a class="anchor" id="documentencoding"></a><a class="index-entry-id" id="index-documentencoding"></a>
<a class="index-entry-id" id="index-Encoding_002c-declaring"></a>
<a class="index-entry-id" id="index-Input-encoding_002c-declaring"></a>
<a class="index-entry-id" id="index-Character-set_002c-declaring"></a>
<a class="index-entry-id" id="index-Document-input-encoding"></a>
<p>The <code class="code">@documentencoding</code> command declares the input document
encoding, and can also affect the encoding of the output. Write it on
a line by itself, with a valid encoding specification following, near
the beginning of the file.
</p>
<div class="example">
<pre class="example-preformatted">@documentencoding <var class="var">enc</var>
</pre></div>
<p>Texinfo supports these encodings:
</p>
<dl class="table">
<dt><code class="code">US-ASCII</code></dt>
<dd><p>This has no particular effect, but it&rsquo;s included for completeness.
</p>
</dd>
<dt><code class="code">UTF-8</code></dt>
<dd><p>The default. The vast global character encoding, expressed in 8-bit bytes.
</p>
</dd>
<dt id='index-Euro-symbol_002c-and-encodings'><span><code class="code">ISO-8859-1</code><a class="copiable-link" href='#index-Euro-symbol_002c-and-encodings'> &para;</a></span></dt>
<dt><code class="code">ISO-8859-15</code></dt>
<dt><code class="code">ISO-8859-2</code></dt>
<dd><p>These specify the standard encodings for Western European (the first
two) and Eastern European languages (the third), respectively. ISO
8859-15 replaces some little-used characters from 8859-1 (e.g.,
precomposed fractions) with more commonly needed ones, such as the
Euro symbol (&euro;).
</p>
<p>A full description of the encodings is beyond our scope here;
one useful reference is <a class="uref" href="http://czyborra.com/charsets/iso8859.html">http://czyborra.com/charsets/iso8859.html</a>.
</p>
</dd>
<dt><code class="code">koi8-r</code></dt>
<dd><p>This is the commonly used encoding for the Russian language.
</p>
</dd>
<dt><code class="code">koi8-u</code></dt>
<dd><p>This is the commonly used encoding for the Ukrainian language.
</p>
</dd>
</dl>
<p>Specifying an encoding <var class="var">enc</var> has the following effects:
</p>
<a class="index-entry-id" id="index-Local-Variables-section_002c-for-encoding"></a>
<a class="index-entry-id" id="index-Info-output_002c-and-encoding"></a>
<p>In Info output, a so-called &lsquo;Local Variables&rsquo; section (see <a data-manual="emacs" href="https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html#File-Variables">File
Variables</a> in <cite class="cite">The GNU Emacs Manual</cite>) is output including
<var class="var">enc</var>. This allows Info readers to set the encoding
appropriately. It looks like this:
</p>
<div class="example">
<pre class="example-preformatted">Local Variables:
coding: <var class="var">enc</var>
End:
</pre></div>
<p>Also, in Info and plain text output, unless the option
<samp class="option">--disable-encoding</samp> is given to <code class="command">makeinfo</code>, accent
constructs and special characters, such as <code class="code">@'e</code>, are output as
the actual 8-bit or UTF-8 character in the given encoding where
possible.
</p>
<a class="index-entry-id" id="index-HTML-output_002c-and-encodings"></a>
<a class="index-entry-id" id="index-http_002dequiv_002c-and-charset-specification"></a>
<a class="index-entry-id" id="index-_003cmeta_003e-HTML-tag_002c-and-charset-specification"></a>
<p>In HTML output, a &lsquo;<samp class="samp">&lt;meta&gt;</samp>&rsquo; tag is output, in the &lsquo;<samp class="samp">&lt;head&gt;</samp>&rsquo;
section of the HTML, that specifies <var class="var">enc</var>. Web servers and
browsers cooperate to use this information so the correct encoding is
used to display the page, if supported by the system. That looks like
this:
</p>
<div class="example">
<pre class="example-preformatted">&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;
charset=<var class="var">enc</var>&quot;&gt;
</pre></div>
<p>In HTML output, if the option <samp class="option">--enable-encoding</samp> is given
to <code class="command">texi2any</code>, accent constructs and special characters, such
as <code class="code">@'e</code> or <code class="code">``</code>, are output as the actual 8-bit or UTF-8
character in the given encoding where possible. Otherwise HTML entities
are used for those characters.
</p>
<p>In XML and DocBook output, UTF-8 is always used for the output,
according to the conventions of those formats.
</p>
<a class="index-entry-id" id="index-Computer-Modern-fonts"></a>
<p>In TeX output, the characters which are supported in the standard
Computer Modern fonts are output accordingly. For example, this
means using constructed accents rather than precomposed glyphs.
Using a missing character generates a warning message, as does
specifying an unimplemented encoding.
</p>
<p>Although modern TeX systems support nearly every script in use in
the world, this wide-ranging support is not available in
<samp class="file">texinfo.tex</samp>, and it&rsquo;s not feasible to duplicate or incorporate
all that effort. (Our plan to support other scripts is through the
LaTeX back-end to <code class="command">texi2any</code>.)
</p>
<p>For maximum portability of Texinfo documents across the many different
user environments in the world, we recommend sticking to 7-bit ASCII
in the input unless your particular manual needs a substantial amount
of non-ASCII, e.g., it&rsquo;s written in German. You can use the
<code class="code">@U</code> command to insert an occasional needed character
(see <a class="pxref" href="Inserting-Unicode.html">Inserting Unicode: <code class="code">@U</code></a>).
</p>
</div>
<hr>
<div class="nav-panel">
<p>
Previous: <a href="_0040documentlanguage.html"><code class="code">@documentlanguage <var class="var">ll</var>[_<var class="var">cc</var>]</code>: Set the Document Language</a>, Up: <a href="Internationalization.html">Internationalization</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>