Bruce Korb <bk...@gnu.org> writes: > 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 think what happened is that the scm_from_latin_string *did* work, but printing did not work. That's because when the locale is set to "C", that means ASCII-only, so it was unable to print the copyright symbol. > 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. Bruce, if you refuse to fix these problems properly, you will end up with a broken program. Period. Full stop. Most modern distributions use UTF-8 by default, and if you simply write a bare 0xA9 to the terminal or output file, that's not going to look right on their terminal or editor. But if that's really what you want, fine, here's how you do it: (fluid-set! %default-port-encoding "ISO-8859-1") (set-port-encoding! (current-output-port) "ISO-8859-1") (set-port-encoding! (current-input-port) "ISO-8859-1") (set-port-encoding! (current-error-port) "ISO-8859-1") and make sure to *not* set the locale. Mark