Re: PATCH: redefine $decimal, $hex, $text vars

Jacob Bachmeyer <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
Ben Elliston wrote:
> On Thu, Dec 13, 2018 at 12:01:30AM -0600, Jacob Bachmeyer wrote:
>   
>> Are we sure that DejaGnu should be sensitive to locales at all?
>> Perhaps the runtest shell script should always export LOCALE=C?
>>     
>
> What if I want to test locale support in an application? I think
> forcing LANG=C is rather heavy handed.
>   

The test scripts could override it if needed.  Actually, test scripts 
for locale support would need to force a specific locale in order to 
test locale support in any case.  I am not suggesting repeatedly setting 
LANG=C, only once in the outer script, very early before any init files 
are read, preferably before Expect is even started.  I think that it is 
very bad for test results to vary with locale, as could happen 
currently.  Using the C locale by default prevents this.

If I understand correctly, the C locale is the only locale POSIX 
actually defines.

We could add a "testsuite locale" API call as a convenience mechanism 
for setting locale variables for child processes.

Lastly, if I read the Tcl documentation (particularly the re_syntax 
page) correctly, none of this actually matters for DejaGnu itself 
because Tcl does not really support locales -- Tcl has only one locale, 
for Unicode, and whether that means that the RE character classes refer 
only to ASCII or to Unicode character properties does not seem to be 
clearly documented.


-- Jacob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.