texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Input/output encoding is used irrespective of @do


From: Patrice Dumas
Subject: branch master updated: Input/output encoding is used irrespective of @documentencoding
Date: Wed, 20 Jul 2022 18:53:23 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 723da3e34a Input/output encoding is used irrespective of 
@documentencoding
723da3e34a is described below

commit 723da3e34adff627b013e3f00f86242e52b6c79d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Jul 21 00:47:31 2022 +0200

    Input/output encoding is used irrespective of @documentencoding
    
    * doc/texinfo.texi (@code{@@documentencoding}): the output of
    encoding information does not depends on @documentencoding being
    set.  Emphasize more than UTF-8 is the default encoding.
    Explain what --enable-encoding does for LaTeX.
    Correct the description for XML and DocBook, they are affected by
    @documentencoding and --enable-encoding.
    
    * doc/texinfo.texi (Invoking @command{texi2any}), tp/texi2any.pl:
    document what --enable-encoding does for HTML, TexinfoXML and DocBook.
---
 ChangeLog        | 14 +++++++++++++
 doc/texinfo.texi | 64 ++++++++++++++++++++++++++++++++------------------------
 tp/TODO          | 16 --------------
 tp/texi2any.pl   | 32 +++++++++++++++++-----------
 4 files changed, 71 insertions(+), 55 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c5de831f1a..8fd0c2f988 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,20 @@
        * NEWS: Remove entry about generating menus as this is not a
        new feature.
 
+2022-20-07  Patrice Dumas  <pertusus@free.fr>
+
+       Input/output encoding is used irrespective of @documentencoding
+
+       * doc/texinfo.texi (@code{@@documentencoding}): the output of
+       encoding information does not depends on @documentencoding being
+       set.  Emphasize more than UTF-8 is the default encoding.
+       Explain what --enable-encoding does for LaTeX.
+       Correct the description for XML and DocBook, they are affected by
+       @documentencoding and --enable-encoding.
+
+       * doc/texinfo.texi (Invoking @command{texi2any}), tp/texi2any.pl:
+       document what --enable-encoding does for HTML, TexinfoXML and DocBook.
+
 2022-20-07  Patrice Dumas  <pertusus@free.fr>
 
        Describe @-commands roles in Command List, not formatting
diff --git a/doc/texinfo.texi b/doc/texinfo.texi
index a4887bc2be..711e7baecb 100644
--- a/doc/texinfo.texi
+++ b/doc/texinfo.texi
@@ -12408,10 +12408,13 @@ the official web site for ISO@tie{}3166 can be found 
via
 @cindex Character set, declaring
 @cindex Document input encoding
 
-The @code{@@documentencoding} 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.
+In the default case, the input and output document encoding are assumed
+to be UTF-8, which is compatible with 7-bit ASCII.  The
+@code{@@documentencoding} command declares the input document encoding, and
+also affects the encoding of the output.  Write it on a line by itself, with a
+valid encoding specification following, near the beginning of the file if your
+document encoding is not the default encoding or if you want to set the
+encoding explicitly.
 
 @example
 @@documentencoding @var{enc}
@@ -12421,7 +12424,7 @@ Texinfo supports these encodings:
 
 @table @code
 @item US-ASCII
-This has no particular effect, but it's included for completeness.
+Character encoding based on the English alphabet.
 
 @item UTF-8
 The default.  The vast global character encoding, expressed in 8-bit bytes.
@@ -12447,49 +12450,51 @@ This is the commonly used encoding for the Ukrainian 
language.
 
 @end table
 
-Specifying an encoding @var{enc} has the following effects:
-
 @cindex Local Variables section, for encoding
 @cindex Info output, and encoding
 In Info output, a so-called `Local Variables' section (@pxref{File
 Variables,,, emacs, The GNU Emacs Manual}) is output including
-@var{enc}.  This allows Info readers to set the encoding
+the output encoding.  This allows Info readers to set the encoding
 appropriately.  It looks like this:
 
 @example
 Local Variables:
-coding: @var{enc}
+coding: UTF-8
 End:
 @end example
 
 Also, in Info and plain text output, unless the option
 @option{--disable-encoding} is given to @command{makeinfo}, accent
 constructs and special characters, such as @code{@@'e}, are output as
-the actual 8-bit or UTF-8 character in the given encoding where
+the actual 8-bit or UTF-8 character in the output encoding where
 possible.
 
 @cindex HTML output, and encodings
 @cindex @code{http-equiv}, and charset specification
 @cindex @code{<meta>} HTML tag, and charset specification
 In HTML output, a @samp{<meta>} tag is output, in the @samp{<head>}
-section of the HTML, that specifies @var{enc}.  Web servers and
+section of the HTML, that specifies the output encoding.  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:
 
 @example
 <meta http-equiv="Content-Type" content="text/html;
-     charset=@var{enc}">
+     charset=utf-8">
 @end example
 
-In HTML output, if the option @option{--enable-encoding} is given
-to @command{texi2any}, accent constructs and special characters, such
-as @code{@@'e} or @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.
+In HTML and @LaTeX{} output, if the option @option{--enable-encoding} is given
+to @command{texi2any}, accent constructs and special characters, such as
+@code{@@'e} or @code{``}, are output as the actual 8-bit or UTF-8 character in
+the output encoding where possible.  Otherwise HTML entities are used for those
+characters in HTML, and @LaTeX{} macros are used in @LaTeX{}.
 
-In XML and DocBook output, UTF-8 is always used for the output,
-according to the conventions of those formats.
+In XML and DocBook output, if the encoding is different from UTF-8,
+an @code{encoding} attribute is added to the XML declaration.
+If the option @option{--enable-encoding} is given to @command{texi2any},
+accent constructs such as @code{@@'e} are output as the actual 8-bit or
+UTF-8 character in the output encoding where possible.  Otherwise XML
+entities are used for those constructs.
 
 @cindex Computer Modern fonts
 In @TeX{} output, the characters which are supported in the standard
@@ -12505,11 +12510,11 @@ all that effort.
 
 In @LaTeX{} output, code loading the @samp{inputenc} package is output
 based on the encoding.  This, by itself, does not ensures that all
-the characters can be subsequently output.  The fonts used in the
-default case should cover the specific Texinfo glyphs, but not all
-the possible encoded characters.  You may need to load
-different fonts in the Texinfo preamble and use
-@code{\DeclareUnicodeCharacter} with a UTF-8 encoding.  For example
+the characters from the input document  can be subsequently output.
+The fonts used in the default case should cover the specific Texinfo
+glyphs, but not all the possible encoded characters.  You may need to
+load different fonts in the Texinfo preamble and use
+@code{\DeclareUnicodeCharacter} with a UTF-8 encoding.  For example:
 @example
 @@latex
 \DeclareUnicodeCharacter@{017B@}@{\.Z@}
@@ -15559,11 +15564,16 @@ Info (@pxref{@command{texi2any} Printed Output}).
 @vindex ENABLE_ENCODING
 By default, or with @option{--enable-encoding}, output accented and
 special characters in Info and plain text output based on
-@samp{@@documentencoding}.  With @option{--disable-encoding}, 7-bit
-ASCII transliterations are output.  @xref{@code{@@documentencoding}},
+the document encoding.  With @option{--disable-encoding}, 7-bit
+ASCII transliterations are output.
+
+By default, or with @option{--disable-encoding}, output accented and
+special characters in HTML, TexinfoXML and DocBook using XML entities.
+With @option{--enable-encoding}, output accented characters in HTML,
+TexinfoXML and DocBook output and special characters in HTML output
+based on the document encoding.  @xref{@code{@@documentencoding}},
 and @ref{Inserting Accents}.
 
-
 @item --error-limit=@var{limit}
 @itemx -e @var{limit}
 @opindex --error-limit=@var{limit}
diff --git a/tp/TODO b/tp/TODO
index f6acd2dd67..d5ea64aa77 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -17,22 +17,6 @@ xterm &
 Before next release
 ===================
 
-
-@item --enable-encoding
-@itemx --disable-encoding
-@opindex --enable-encoding
-@opindex --disable-encoding
-@vindex ENABLE_ENCODING
-By default, or with @option{--enable-encoding}, output accented and
-special characters in Info and plain text output based on
-@samp{@@documentencoding}.  With @option{--disable-encoding}, 7-bit
-ASCII transliterations are output.  @xref{@code{@@documentencoding}},
-and @ref{Inserting Accents}.
-
-=> does not really depend on @documentencoding, change to read
-Texinfo input manual encoding?
-
-
 Bugs
 ====
 
diff --git a/tp/texi2any.pl b/tp/texi2any.pl
index 6f8fc978b0..822b1e1796 100755
--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -769,22 +769,30 @@ the behavior is identical, and does not depend on the 
installed name.\n")
                                 a directory or ends with a /,
                                 put the output file there.
                                 Otherwise, DEST names the output file.")."\n"
+.__(
+"      --disable-encoding      do not output accented and special characters
+                                in Info output based on document 
encoding.")."\n"
+.__(
+"      --enable-encoding       based on document encoding, output accented
+                                characters in XML-based output as well as
+                                special characters in HTML instead of
+                                entities.")."\n"
 ."\n";
-  # TODO: avoid \n in translated strings, split each option in a translatable
-  # string.  Report from Benno Schulenberg
-  $makeinfo_help .= sprintf(__("Options for Info and plain text:
-      --disable-encoding      do not output accented and special characters
-                                in Info output based on \@documentencoding.
-      --enable-encoding       override --disable-encoding (default).
-      --fill-column=NUM       break Info lines at NUM columns (default %d).
-      --footnote-style=STYLE  output footnotes in Info according to STYLE:
+  $makeinfo_help .= sprintf(__("Options for Info and plain text:")."\n"
+.__(
+"      --fill-column=NUM       break Info lines at NUM columns (default 
%d).")."\n"
+.__(
+"      --footnote-style=STYLE  output footnotes in Info according to STYLE:
                                 `separate' to put them in their own node;
                                 `end' to put them at the end of the node, in
-                                which they are defined (this is the default).
-      --paragraph-indent=VAL  indent Info paragraphs by VAL spaces (default 
%d).
+                                which they are defined (this is the 
default).")."\n"
+.__(
+"      --paragraph-indent=VAL  indent Info paragraphs by VAL spaces (default 
%d).
                                 If VAL is `none', do not indent; if VAL is
-                                `asis', preserve existing indentation.
-      --split-size=NUM        split Info files at size NUM (default %d).\n"),
+                                `asis', preserve existing indentation.")."\n"
+.__(
+"      --split-size=NUM        split Info files at size NUM (default 
%d).")."\n"
+."\n".
     _get_converter_default('FILLCOLUMN'),
     _get_converter_default('paragraphindent'), 
     _get_converter_default('SPLIT_SIZE'))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]