From 4cd7b957f382c1d961641629a84ada8384953598 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 30 Jun 2006 09:41:34 +0000 Subject: 22529: multibyte conversion in math expressions --- Src/math.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Src/math.c') diff --git a/Src/math.c b/Src/math.c index 336416597..bd48288ec 100644 --- a/Src/math.c +++ b/Src/math.c @@ -549,8 +549,20 @@ getcvar(char *s) queue_signals(); if (!(t = getsparam(s))) mn.u.l = 0; - else - mn.u.l = STOUC(*t == Meta ? t[1] ^ 32 : *t); + else { +#ifdef MULTIBYTE_SUPPORT + if (isset(MULTIBYTE)) { + wint_t wc; + (void)mb_metacharlenconv(t, &wc); + if (wc != WEOF) { + mn.u.l = (zlong)wc; + unqueue_signals(); + return mn; + } + } +#endif + mn.u.l = STOUC(*t == Meta ? t[1] ^ 32 : *t); + } unqueue_signals(); return mn; } -- cgit 1.4.1