1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

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
This commit is contained in:
Michael Gran 2009-08-27 07:34:48 -07:00
parent f49dbcadf3
commit 930ddd34c3

View file

@ -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
{