Hello,

On Fri, Nov 16, 2012 at 6:32 PM, Bruce Korb <bk...@gnu.org> wrote:

> On 11/16/12 13:23, Mark H Weaver wrote:
> >> Actually, it was scm_from_utf8_string, since GUILE_VERSION was 200005
> >
> > Okay, that's the problem.  You told Guile that the C string was encoded
> > in UTF-8, but actually it was encoded in Latin-1:
>
> OK, so I tried latin1, too.  (replacing scm_from_utf3_string with
> scm_from_latin1_string).  That also does not work.  It replaced the
> 0xA9 character with '?'.


I am no expert on character encodings, but we've seen errors like this
before where it turned out that Guile was attempting to display the
character on a terminal which didn't support it, and then the terminal
converted it into '?'. Could there have been some change in how Guile
displays strings that caused this error? Did it used to show a \-escape
sequence?


> What it all boils down to is that
> I am looking for string handling functions that will handle the
> NUL terminated list of bytes and keep its nose out of the contents
> of the string.  Period.  Full stop.
>

Could you explain what you're trying to do a little more? If you're calling
a function that looks at characters on a string object that doesn't contain
valid characters, then it will fail. If you have a NUL-terminated list of
bytes that contains only characters valid in some encoding, then the
scm_from_*_string functions are supposed to wrap it. So do you intend to
make a string object and then never look inside? Or are you going to roll
your own string-handling starting from byte sequences? The rest of your
email suggests not.

Thanks,
Noah

Reply via email to