Possible bug?

Per Hedeland per@REDACTED
Wed Feb 3 09:50:16 CET 1999


Klacke wrote:
>Basically Erlang doesn't really support anything but plain ascii
>today. However the usage of non-ascii characters should not
>lead to compile time errors, only to ugly printouts.

Actually, if you (on Solaris) set environment LANG=sv, or
LC_CTYPE=iso_8859_1, your example produces a perfectly beautiful
printout:

1> a:a().
"åääää"

I.e. Erlang uses the standardized isprint() etc functions, whose
behaviour, assuming you have called the standardized setlocale()
function properly (which Erlang does), is supposed to depend on the
standardized environment variables LANG, LC_CTYPE, etc. Unfortunately
the *values* of those variables aren't standardized:-(, you'll have to
check your OS documentation to see what it wants/supports.

(On Solaris some documentation can be found in setlocale(3C) and
friends, but I believe you have to go hunting in the filesystem
(/usr/lib/locale) to find the actual values.)

--Per Hedeland
per@REDACTED

PS Other things (outside Erlang) may "break" in particular if you set
LANG, e.g. floating point numbers, dates, error messages, etc may start
to get printed in funny ways that the standardization bodies think you
want - I guess some would call this a "feature" - oh well...:-)





More information about the erlang-questions mailing list