From 8c7a66761ae6d8dda0b320a70d47771b9c51aaa9 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 27 Jun 2007 18:00:18 +0000 Subject: [PATCH] * Use cucul_utf32_to_ascii() when the SLang backend does not support UTF-8. --- caca/driver_slang.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/caca/driver_slang.c b/caca/driver_slang.c index 52e843b..671ec00 100644 --- a/caca/driver_slang.c +++ b/caca/driver_slang.c @@ -454,6 +454,8 @@ static void slang_write_utf32(uint32_t ch) #ifdef HAVE_SLSMG_UTF8_ENABLE char buf[10]; int bytes; +#else + char ascii; #endif if(ch == CUCUL_MAGIC_FULLWIDTH) @@ -464,12 +466,10 @@ static void slang_write_utf32(uint32_t ch) buf[bytes] = '\0'; SLsmg_write_string(buf); #else - if(ch < 0x80) - SLsmg_write_char(ch); - else if(cucul_utf32_is_fullwidth(ch)) - SLsmg_write_string("? "); - else - SLsmg_write_char('?'); + ascii = cucul_utf32_to_ascii(ch); + SLsmg_write_char(ascii); + if(cucul_utf32_is_fullwidth(ch)) + SLsmg_write_char(ascii); #endif }