diff libinterp/corefcn/strfns.cc @ 27265:5f65319c7835

Add new function for querying the locale charset. * strfns.cc (F__locale_charset__): New internal function.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 19 Jul 2019 19:07:13 +0200
parents f26b13c80e45
children 4fef3ab19046
line wrap: on
line diff
--- a/libinterp/corefcn/strfns.cc	Thu Jul 18 12:59:57 2019 -0400
+++ b/libinterp/corefcn/strfns.cc	Fri Jul 19 19:07:13 2019 +0200
@@ -976,6 +976,17 @@
   return ovl (retval);
 }
 
+DEFUN (__locale_charset__, , ,
+       doc: /* -*- texinfo -*-
+@deftypefn {} {@var{charset} =} __locale_charset__ ()
+Return the identifier for the charset used if the encoding is set to "locale".
+@end deftypefn */)
+{
+  const char *charset = octave_locale_charset_wrapper ();
+  std::string charset_str (charset);
+  return ovl (charset_str);
+}
+
 DEFUN (unicode_idx, args, ,
        doc: /* -*- texinfo -*-
 @deftypefn {} {@var{idx} =} unicode_idx (@var{str})