octave-maintainers
[Top][All Lists]
Advanced

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

Added two core functions: locale() and setlocale()


From: Júlio Hoffimann
Subject: Added two core functions: locale() and setlocale()
Date: Mon, 14 Jan 2013 21:27:34 -0300

Dear all,

This patch introduces two new functions:

 -- Built-in Function: L = locale ()
 -- Built-in Function: BOOL = locale (L)
     Get the user's locale or check if the specified one is installed
     on the system.

     On GNU/Linux you can check the installed locales by issuing
     `locale -a' at the shell.

          locale ()
             => "en_US.UTF-8"

          locale ("pt_BR")
             => true

          locale ("fr_FR")
             => false

     *See also:* setlocale.

and

 -- Built-in Function: OLD = setlocale (NEW)
     Set the locale and return the previous.
          setlocale (locale ())
             => "C"

          setlocale (locale ())
             => "en_US.UTF-8"

     *See also:* locale.

I don't know if corefcn is the better place for them, any suggestions? Any comments you want to add about the code? What could be done better?

The patch also fixes an old test failure with sscanf() and locale.

Item created in Savannah: https://savannah.gnu.org/patch/?7924

Best,
Júlio.

reply via email to

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