guile-user
[Top][All Lists]
Advanced

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

Re: I'm looking for a method of converting a string's character encoding


From: Thien-Thi Nguyen
Subject: Re: I'm looking for a method of converting a string's character encoding
Date: Sat, 28 Apr 2012 21:54:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

() Daniel Krueger <address@hidden>
() Sat, 28 Apr 2012 20:29:22 +0200

   i think there shouldn't be any transcoding of guile's strings,
   as strings are internal representation of characters, no matter
   how they are encoded. So the only time when encoding matters is
   when it passes it's `internal boundarys', i mean if you write
   the string to a port or read from a port or pass it as a string
   to a foreign library.

Indeed, iconv(1) converts external representations (files).  How
it does that internally is an implementation detail.  That's the
main reason why i suggested it as a model for exercising Guile's
internals -- it's very easy to check correctness.

   For the ports all transcoding is available, and as said, the
   real representation of guile strings internally is as utf8,
   which can't be changed.

IIUC, the internal representation of strings is not UTF-8 (at
least, not all the time), but anyway, that doesn't matter at all.
The proposed task is to use procedures and features provided by
Guile (i.e., its public API) to do mimic iconv.

   The only additional thing i forgot about are bytevectors, if
   you convert a string to an explicit representation, but afaik
   there you also can give the encoding to use.

   Am I wrong?

I don't know.



reply via email to

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