From edfcc10876472e616a241393a4b4c5bbdb7b7aba Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Fri, 10 Jul 2009 14:06:34 +0000 Subject: Correct return value of function get_ucs, position of next character, in viewer plugin (FS #9387, patch by Yoshihisa Uchida, small modification by me). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21743 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/viewer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index e3d0903d01..9db19d4158 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c @@ -462,11 +462,12 @@ unsigned char* get_ucs(const unsigned char* str, unsigned short* ch) rb->utf8decode(utf8_tmp, ch); #ifdef HAVE_LCD_BITMAP - if ((prefs.encoding == SJIS && *str > 0xA0 && *str < 0xE0) || prefs.encoding < SJIS) - return (unsigned char*)str+1; + if (prefs.encoding >= SJIS && *str >= 0x80 + && !(prefs.encoding == SJIS && *str > 0xA0 && *str < 0xE0)) + return (unsigned char*)str+2; else #endif - return (unsigned char*)str+2; + return (unsigned char*)str+1; } bool done = false; -- cgit v1.2.3