Getting ERROR when start SWI-Prolog on Mac.

16 views
Skip to first unread message

bai.aa...@gmail.com

unread,
Jan 10, 2017, 4:31:04 PM1/10/17
to SWI-Prolog
I saw some others also have this problem, I have no idea to handle that.

屏幕快照 2017-01-10 下午10.26.12.png

Jan Wielemaker

unread,
Jan 11, 2017, 5:56:36 AM1/11/17
to bai.aa...@gmail.com, SWI-Prolog
On 01/10/2017 10:31 PM, bai.aa...@gmail.com wrote:
> I saw some others also have this problem, I have no idea to handle that.

I am travelling and don't have a mac around. From what I recall, the
problem
is that Mac apps get (by default) no environment and thus the normal Unix
locale initialisation fails. I _think_ there is some xml file in the app
in which you can set environment variables. In that case you can set LANG
appropriately and you should be fine.

If you use a UTF-8 based locale, you might also get away using this in
~/.swiplrc:

:- set_encoding(utf8).

Using setlocale/3 may also help.

The proper solution is to use Mac APIs to initialise the locale. I anyone
knows how to do that from plain C, please share it. If anyone has a work
around, please share it too.

Cheers --- Jan


>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.

Samer Abdallah

unread,
Jan 11, 2017, 7:07:11 AM1/11/17
to bai.aa...@gmail.com, SWI-Prolog
I seem to remember there are several ways of setting environment
variables for applications in Mac OS, and which one works depends
on what kind mood Apple was in when they released whichever version
of Mac OS you are using.

I think magic files in your home directory or the application no longer
work. This might do the trick on more recent versions:
http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-launchd-plist/

Samer.
> To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
signature.asc
Reply all
Reply to author
Forward
0 new messages