Fix encoding errors with strings returned by string ports
authorMichael Gran <spk121@yahoo.com>
Sun, 30 Aug 2009 22:41:56 +0000 (15:41 -0700)
committerMichael Gran <spk121@yahoo.com>
Sun, 30 Aug 2009 23:54:49 +0000 (16:54 -0700)
commitfac32b518ef9f456e8f6465c00e6c6f40a1123a8
treeade50d4935f7e3cc6143ac13d32f91ff2ad5c233
parentf84c500d2e29c619e6a989d0d11911fea414d795
Fix encoding errors with strings returned by string ports

String ports, being 8-bit, store strings using the character encoding
of the port.  This fixes a bug where the default character encoding, and
not the port's encoding, was being used to convert the string port data
back to a string.

* libguile/strports.c: extra comments
  (scm_strport_to_string):  use port's encoding when converting port data
  to a string

* libguile/strings.c (scm_i_from_stringn): renamed from scm_from_stringn
  and made internal.  All callers changed.
  (scm_from_stringn): renamed to scm_i_from_stringn.

* libguile/strings.h: declaration for scm_i_from_stringn
libguile/strings.c
libguile/strings.h
libguile/strports.c