diff options
Diffstat (limited to 'plugins/SpellChecker/src/hunspell/hunspell.cxx')
-rw-r--r-- | plugins/SpellChecker/src/hunspell/hunspell.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/SpellChecker/src/hunspell/hunspell.cxx b/plugins/SpellChecker/src/hunspell/hunspell.cxx index 8e00e1b8cc..6b35fb51e0 100644 --- a/plugins/SpellChecker/src/hunspell/hunspell.cxx +++ b/plugins/SpellChecker/src/hunspell/hunspell.cxx @@ -242,10 +242,25 @@ int Hunspell::mkallcap2(char * p, w_char * u, int nc) void Hunspell::mkallsmall(char * p) { + if (utf8) { + w_char u[MAXWORDLEN]; + int nc = u8_u16(u, MAXWORDLEN, p); + unsigned short idx; + for (int i = 0; i < nc; i++) { + idx = (u[i].h << 8) + u[i].l; + unsigned short low = unicodetolower(idx, langnum); + if (idx != low) { + u[i].h = (unsigned char) (low >> 8); + u[i].l = (unsigned char) (low & 0x00FF); + } + } + u16_u8(p, MAXWORDUTF8LEN, u, nc); + } else { while (*p != '\0') { *p = csconv[((unsigned char) *p)].clower; p++; } + } } int Hunspell::mkallsmall2(char * p, w_char * u, int nc) |