[erlang-questions] Erlang string datatype [cookbook entry #1 - unicode/UTF-8 strings]

Vlad Dumitrescu vladdu55@REDACTED
Fri Oct 21 12:00:28 CEST 2011


On Thu, Oct 20, 2011 at 19:42, Robert Virding
<robert.virding@REDACTED> wrote:
> This discussion of Erlang strings/unicode/string type/... crops up
> regularly. What I would like to discuss around this is: if we were to add a
> string datatype to Erlang what properties should it have? If we skip
> internal implementation details how should it behave? What type of
> operations could do on them? And why? For example would I want to be able to
> step over/create them in a similar manner as with lists? An when I access a
> "character" (whatever that may be) what do I see?
> Encoded/unencoded/codepoint or what?
> Once that has been agreed on, if we can, then it would be relatively easy to
> implement a string data type. If we want to.

I think it is easier to understand and use a string datatype that when
needed can be converted to a list of characters/codepoints/bytes than
having a multitude of data types that sometimes can be interpreted as
strings and also need additional information (the encoding) to be
processed properly.

best regards,

More information about the erlang-questions mailing list