guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guile can't find a chinese named file


From: Jan Wedekind
Subject: Re: guile can't find a chinese named file
Date: Mon, 27 Feb 2017 20:24:19 +0000 (GMT)
User-agent: Alpine 2.11 (DEB 23 2013-08-11)

Hi :)

On Mon 27 Feb 2017 17:07, Eli Zaretskii <address@hidden> writes:

From: Andy Wingo <address@hidden>
Date: Sun, 26 Feb 2017 22:20:31 +0100

In Scheme, strings are sequences of characters.  Encoding and decoding
is only needed when going to and from bytes.  Guile supports a finite
number of encodings, so in general some encoding/decoding will always be
needed.  The specific encoding may change over time.

The lesson of Emacs development is that there's a need for
"characters" that represent raw bytes which cannot be decoded into the
internal representation, for whatever reasons.  These special
"characters" need to be representable in strings, among "normal"
recognizable characters (and thus distinguishable from the latter
kind), and they need to be converted back to their single-byte form
when the string is output to the external world.  An implementation of
text that doesn't include these features will always fail to support
some important use cases.

Thanks for this note (and upthread).  I didn't know Emacs settled on
this strategy.  It could fit in as a new "conversion strategy" (see
Encoding in the manual).

I think this feature will probably slip for 2.2.0 for lack of time,
though.  When someone does go to look at it, this thread is a useful
resource, or parts of it anyway :) I especially appreciated the
tradeoffs between surrogates and strange UTF-8 hacks.

Andy




The encoding support of the Ruby programming language [1] is IMHO pretty good. It can handle different encodings for source code, input/output, string variables, and regular expressions. UTF-8 is the preferred encoding but other encodings are required. E.g. Ruby is used a lot in Japan and there are many "Kanji" which are currently not covered by UTF-8.

[1] http://nuclearsquid.com/writings/ruby-1-9-encodings/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]