From 4c038a737bb8c9849497f8b3162efa67de7a4aa2 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Thu, 20 Sep 2012 12:25:45 +0100 Subject: [PATCH] Ensure that multibyte chars are properly converted for ISO 6937. --- src/dvb/dvb_support.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dvb/dvb_support.c b/src/dvb/dvb_support.c index d9902878..e1066c0c 100644 --- a/src/dvb/dvb_support.c +++ b/src/dvb/dvb_support.c @@ -141,7 +141,7 @@ static inline size_t conv_6937(const uint8_t *src, size_t srclen, dst++; } else { uint16_t uc; - if (c <= 0x9f) { + if (c >= 0xc0 && c <= 0xcf) { // map two-byte sequence, skipping illegal combinations. if (srclen<2) { errno = EINVAL; @@ -155,7 +155,7 @@ static inline size_t conv_6937(const uint8_t *src, size_t srclen, } else if (c2 >= 0x41 && c2 <= 0x5a) { uc = iso6937_multi_byte[c-0xc0][c2-0x41]; } else if (c2 >= 0x61 && c2 <= 0x7a) { - uc = iso6937_multi_byte[c-0xc0][c2-0x61]; + uc = iso6937_multi_byte[c-0xc0][c2-0x61+26]; } else { uc = 0; }