[erlang-questions] Strings as Lists

Bob Calco bobcalco@REDACTED
Thu Feb 14 13:09:43 CET 2008


Hasan:

> Erlang currently sucks for working with Unicode, and as a
> consequence, sucks for working with strings.
> 
> This isn't a fault of the language, just the lack of libraries.

<...>
 
> As soon as you've got text in anything other than ISO Latin-1, the
> arguments about niceties of being able to do maps/folds/
> comprehensions on lists pretending to be strings become void. You
> can't reliably iterate over each character in a UTF-8 or UTF-16
> string in a plain list, because they are variable-width encodings.
> Neither could you do it even if your strings were in UTF-32, because
> they may have composed characters, and you'd have to normalize the
> string first... and then you're well on your way to re-implementing
> Unicode in Erlang yourself. Good luck.

I have run into this brick wall as well.

> Anyway, I've been working on an Erlang Unicode string library based
> on ICU (http://www.icu-project.org/) for the past week. It's coming
> along nicely, and I'll release an alpha version in another week or so.

Excellent!

> Erlang is a great language and platform, and non-existent Unicode
> support is probably the biggest drawback it has. I hope we'll get it
> fixed soon.

Why don't you open a project on Google code so other folks can chip in? I for one would also like to see this capability added to Erlang as well.

Sincerely,

[X || X <- [47,66,111,98,32,59,41]].




More information about the erlang-questions mailing list