[m-users.] How to set the locale?

Julien Fischer jfischer at opturion.com
Sun Oct 10 16:12:46 AEDT 2021


Hi,

On Sat, 9 Oct 2021, Volker Wysk wrote:

> Hi!
>
> Mercury programs appear not to set the locale at startup, using
>
>   setlocale(LC_ALL, "");
>
> How should the locale be set in Mercury? Is it necessary to use the foreign
> language interface?

Yes, it's necessary to use the foreign language interface; there is
(currently) nothing in the standard library for setting the locale.

> This leads to my second question: How to quote quotation marks inside the
> body of a foreign predicate, which consists of C code?

Foreign proc, decl and code bodies are just string literals; just use
the usual character escapes.

Julien.


More information about the users mailing list