diff options
author | Michael Gran <spk121@yahoo.com> | 2009-08-30 15:41:56 -0700 |
---|---|---|
committer | Michael Gran <spk121@yahoo.com> | 2009-08-30 16:54:49 -0700 |
commit | fac32b518ef9f456e8f6465c00e6c6f40a1123a8 (patch) | |
tree | ade50d4935f7e3cc6143ac13d32f91ff2ad5c233 /libguile/strings.h | |
parent | f84c500d2e29c619e6a989d0d11911fea414d795 (diff) | |
download | guile-fac32b518ef9f456e8f6465c00e6c6f40a1123a8.tar.gz |
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
Diffstat (limited to 'libguile/strings.h')
-rw-r--r-- | libguile/strings.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libguile/strings.h b/libguile/strings.h index 2393aae91..c5219265e 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -111,6 +111,10 @@ SCM_API SCM scm_substring_shared (SCM str, SCM start, SCM end); SCM_API SCM scm_substring_copy (SCM str, SCM start, SCM end); SCM_API SCM scm_string_append (SCM args); +SCM_INTERNAL SCM scm_i_from_stringn (const char *str, size_t len, + const char *encoding, + scm_t_string_failed_conversion_handler + handler); SCM_API SCM scm_c_make_string (size_t len, SCM chr); SCM_API size_t scm_c_string_length (SCM str); SCM_API size_t scm_c_symbol_length (SCM sym); |