[erlang-questions] correct terminology for referring to strings

CGS <>
Wed Aug 1 14:25:50 CEST 2012

On Wed, Aug 1, 2012 at 10:39 AM, Richard Carlsson <
> wrote:

> On 08/01/2012 12:52 AM, CGS wrote:
>> Actually, try this:
>> 1. set your environment to UTF-8 (in my case, whatever Linux terminal
>> with BASH environment, export LANG="en_US.utf8", use locale to find your
>> environment language definition - "en_US.latin1" for LATIN-1)
>> 2. in a module:
>> test_reverse(String) -> lists:reverse(String).
>> 3. Give as parameter the example given by yourself.
>> 4. Check the output.
> Ah, but when you say "give as parameter" you mean "pass it a string
> literal from the shell", right?

Yes. Sorry for the confusion.

> I never said anything about strings in the shell - that's a different
> environment from source files, and as you described, the shell nowadays
> detects your locale and translates UTF-8 console input into a string
> literal containing Unicode code points.

The shell was just an example which is a part of the problem. Another part
is the communication over HTTP/HTTPS protocol. And there may be some other
examples. My point here is the interaction of Erlang with any environment
which uses UTF-8. If Erlang compiler doesn't become aware of UTF-8, the
code may be unstable without even understanding why. As you said, it seems
that the compiler needs a fix.

> This is exactly how it would happen in source code as well, if the
> compiler only knew how to detect that a source file is in a different
> encoding from Latin1. So the compiler is really the main thing that needs
> to be fixed, and then there should be no surprises on the encoding level
> anymore.

I couldn't agree more.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120801/93b4e52c/attachment.html>

More information about the erlang-questions mailing list