diff options
author | Michael Gran <spk121@yahoo.com> | 2009-08-27 07:34:48 -0700 |
---|---|---|
committer | Michael Gran <spk121@yahoo.com> | 2009-08-27 07:44:01 -0700 |
commit | 930ddd34c32b2cad49ffb254951e3cac50c1b341 (patch) | |
tree | 3ec4e6903f89b61fe43fb8c38ed60774f286d0d5 /libguile/print.c | |
parent | f49dbcadf3829fe6ca2e4815c2af772360d454e8 (diff) | |
download | guile-930ddd34c32b2cad49ffb254951e3cac50c1b341.tar.gz |
Segfault when writing non-Latin-1 characters under Latin-1 locale
* libguile/print.c (iprin1): handle write of non-Latin-1 characters
under the Latin-1 locale
Diffstat (limited to 'libguile/print.c')
-rw-r--r-- | libguile/print.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libguile/print.c b/libguile/print.c index 4d206eb5b..86d067b8b 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -470,10 +470,15 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) enc = scm_i_get_port_encoding (port); wbuf[0] = i; - if (enc == NULL && i <= 0xFF) + if (enc == NULL) { - /* Character is graphic and Latin-1. Print it */ - scm_lfwrite_str (wstr, port); + if (i <= 0xFF) + /* Character is graphic and Latin-1. Print it */ + scm_lfwrite_str (wstr, port); + else + /* Character is graphic but unrepresentable in + this port's encoding. */ + scm_intprint (i, 8, port); } else { |