[erlang-questions] correct terminology for referring to strings
Richard Carlsson
carlsson.richard@REDACTED
Wed Aug 1 10:39:07 CEST 2012
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? 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. 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.
/Richard
More information about the erlang-questions
mailing list