[erlang-questions] Re: Erlang Idioms - A Pattern for an Erlang Programming Team

Kenji Rikitake kenji.rikitake@REDACTED
Sat Feb 13 06:51:49 CET 2010


In the message <c907d226-14b9-4db1-ae94-8d64ded9da2d@REDACTED>
dated Fri, Feb 12, 2010 at 04:58:37PM -0800,
Steve Davis <steven.charles.davis@REDACTED> writes:
> While it may appear troublesome to type <<"hello">> rather than
> "hello", the rewards in later manipulation is extreme.

This generally only works for ASCII strings, though I agree with the idea.

Erlang's Unicode representation of strings introduces a complication in
this matter.
http://erlang.org/doc/man/unicode.html

Note that my skills on UTF-8 is limited yet; I stay away from using
non-ASCII characters in my own code (and let the others treated as they
are as possible).

Japanese have at least three more traditional coding systems than UTF-8
and I still don't know how I handle them properly without conversion.  
I live in EUC-JP on my FreeBSD systems, in Shift-JIS on the Microsoft
systems (MS-DOS and Windows), and in ISO-2022-JP over the
email. Conversion between UTF-8 and those codes are often poorly
implemented. (e.g., GNU Emacs 22 and 23)  Quite a few modern application
handle all of these encodings, but that doesn't necessarily mean I can
mix them up.

I don't demand Erlang/OTP to deal with all iconv matters anyway;
expanding ASCII+ISO-8859-1 into UTF-8/16/32 has already introduced a lot
of problems to solve, though I appreciate the move because without that
an I18N application for Erlang would not be practically possible.

> I have found this true even when coding for text-based protocols such
> as http. [...]

Quite a few Internet protocols are based on text. See RFC5321 and
RFC5322 for Internet message exchange format, including email.  It's not
just HTTP; HTTP is rather a late comer.

Just my JPY 2 worth.

Regards,
Kenji Rikitake


More information about the erlang-questions mailing list