Swiplserver: load existing prolog file into server

This is a bit of a MacOS issue. SWI-Prolog gets its locale initialization from the environment (LANG and/or LC_* vars) as it is supposed to work on POSIX systems. AFAIK, these variables are by default not set on MacOS. You fix that for the shell by setting them in your shell profile file. That unfortunately doesn’t help for swipl-win, the app. If anyone knows how to initialise the POSIX locale handling in a MacOS app, please let me know.

If you have UTF-8 source files one should have them start with this directive (which may appear above the :- module(....).) to make the file load correctly regardless of the current locale. Ensuring the file has a BOM (Byte Order Mark) also works. Some editors can do that.

 :- encoding(utf8).
1 Like