help-octave
[Top][All Lists]
Advanced

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

utf8 does not appear to work for function documentation strings generate


From: Alan W. Irwin
Subject: utf8 does not appear to work for function documentation strings generated with texinfo
Date: Tue, 25 Mar 2014 19:11:09 -0700 (PDT)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

N.B. to understand this post your system has to be set up to deal
properly with utf8 mail so that the utf8 character ≥ for the
math symbol for "greater than or equal to" in this post is
displayed properly.

To illustrate a problem I have encountered with utf8 in function help
strings in a simple way, I have defined the following function which
outputs the greater than or equal utf8 math symbol:

address@hidden> cat test_utf8.m
## -*- texinfo -*-
## The unicode character, ≥, is output
function test_utf8
printf("The unicode character, ≥, is output\n")
endfunction

If you run this function from octave 3.6.2, you get the expected
utf8 results.

octave:1> test_utf8
The unicode character, ≥, is output

However, the help text for this function is truncated at the unicode
character.

octave:2> help test_utf8
test_utf8' is a function from the file
/home/irwin/test_octave/test_utf8.m

The unicode character,
                      ^^^
[...]

On the other hand, if you drop the

## -*- texinfo -*-

line, the complete help string is output.

Therefore, there appears to be some issue with how octave uses texinfo
or an issue with texinfo itself that is causing the truncation
problem. According to
https://www.gnu.org/software/texinfo/manual/texinfo/html_node/_0040documentencoding.html
texinfo does support utf8.  But I tried some experiments with the
recommended "@documentencoding UTF-8" command to specify that encoding
in the above function, but the truncation issue was always in the
results.

Note, I am interested in the texinfo variant of documentation strings
because that variant appears to be the preferred form of documentation.
Furthermore, for my original much more complicated problem (the Octave binding
for PLplot generated with swig as a C++ extension), the extension is
generated using the DEFUNX_DLD macro, and swig automatically inserts
"-*- texinfo -*-" as the first part of the documentation string for
that macro.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________



reply via email to

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