[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #49339] False error reports while producing la
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #49339] False error reports while producing latex with non-ascii chars under gnuplot |
Date: |
Fri, 3 Mar 2017 14:18:18 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0 |
Follow-up Comment #4, bug #49339 (project octave):
I agree that running octave-cli non-interactively does not initialize the
LC_CTYPE facet correctly, that's the conclusion I came to in comment #2. If
the user does have a DISPLAY, or if Octave is run interactively, it is
initialized correctly.
So it looks like we should handle that use case, I agree, and maybe the
interpreter constructor is the right place.
The appropriate way to initialize this might be something like the following
(adapted from readline):
std::string val = octave::sys::env::getenv ("LC_ALL");
if (val.empty ())
val = octave::sys::env::getenv ("LC_CTYPE");
if (val.empty ())
val = octave::sys::env::getenv ("LANG");
if (val.empty ())
{
char *p = setlocale (LC_CTYPE, 0);
if (p)
val = p;
}
setlocale (LC_CTYPE, val.c_str ());
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49339>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/