Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Strings and things
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
candlerb  
View profile  
 More options Dec 6 2010, 4:48 pm
From: candlerb <b.cand...@pobox.com>
Date: Mon, 6 Dec 2010 13:48:58 -0800 (PST)
Local: Mon, Dec 6 2010 4:48 pm
Subject: Re: Strings and things
On Dec 6, 6:31 pm, Tony Arcieri <tony.arci...@medioh.com> wrote:

> > The erlang way (eep-0010, eep-0011) seems to be:

> > * binaries which contain text can contain utf-8 or latin1. (latin1,
> > being a fixed single-byte encoding, is effectively just binary)
> > * when the operation needs to know which, you say explicitly at the
> > point of operation: e.g. "~s" vs "~ts" for format string, "/utf8"
> > modifier for matching characters in binaries, "unicode" flag to re for
> > regexp matching.

> I'd rather that be automatic, with strings "knowing" they're UTF-8.

I wouldn't, as it leads to all sorts of complexities:

* How do strings get assigned their initial encoding? (String
literals, strings read from stdin, strings read from files, strings
from the O/S like directory listings, ...)
* What happens if string with encoding A is concatenated with a string
of encoding B? What about with the empty string? In general, for every
method which takes string argument(s), how is its behaviour modified
dependent on the encoding of those string(s)?
* For every method which *returns* a string, how is the encoding of
that string chosen?
* Repeat for all system libraries and all third-party libraries

Even if Reia has only a one-bit flag, or two classes (utf8/binary),
these issues all still arise. And yet at the point of interacting with
the operating system, for example when calling read() or readdir(),
strings are just binary data. So all this hidden state has to be
synthesised when data arrives, and thrown away when data leaves.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.