gnu-octave / symbolic

A Symbolic Package for Octave using SymPy
https://octave.sourceforge.io/symbolic/
GNU General Public License v3.0
152 stars 36 forks source link

adopt .oct-config files to indicate source in is utf-8 #1191

Closed cbm755 closed 2 years ago

cbm755 commented 2 years ago

There are new-ish .oct-config files with this content:

encoding=utf-8

These are used to indicate that the source code is in utf-8. Which ours is.

note: we also use have this texinfo: @documentencoding UTF-8 in-place but I'm not sure that is used by Octave's __mfile_encoding / dir_encoding etc. both, we want both.

References:

cbm755 commented 2 years ago

I'm getting failures in Octave 6.4.0 about this when LANG=C (in Fedora 35/36 package builds for example).

A workaround is to do this

__mfile_encoding__("utf-8")

before running doctests.

mmuetzel commented 2 years ago

Afaict, those files have been added to the repository. Is there anything left to do for this?

cbm755 commented 2 years ago

I don't think Symbolic has such files yet. We added them to the Doctest package.

My current understanding packages that have utf-8-encoded source files (like we do) shoulddeclare that so that Octave will DTRT when the system is set to something else.

Actually, it is already declared in most files like this:

%% -*- texinfo -*-
%% @documentencoding UTF-8

but I don't think Octave considers that; rather it is an indicator for texinfo tooling.

mmuetzel commented 2 years ago

Oops. Sorry. Got confused as to which repository this was meant for. Sorry for the noise.