summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-07-10 14:06:34 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-07-10 14:06:34 +0000
commitedfcc10876472e616a241393a4b4c5bbdb7b7aba (patch)
treef8f5b856788a21614167459571197016c6ffe728 /apps
parentc51e26a43da2891db80b9e38dc44b0ab3001afbe (diff)
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
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/viewer.c7
1 files changed, 4 insertions, 3 deletions
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;