diff options
author | sgeerken <devnull@localhost> | 2012-07-12 13:15:20 +0200 |
---|---|---|
committer | sgeerken <devnull@localhost> | 2012-07-12 13:15:20 +0200 |
commit | 2e9c1b2b921a249743b139e7cea3449e642ae30e (patch) | |
tree | 256f8b387dda15ded6d9407c98711ccca4760a2a /dw/hyphenator.cc | |
parent | fa1c054f17f6c71a5314e4c3e638c15aa33ec09c (diff) |
new file "unicode.hh" and "unicode.cc" for Unicode and UTF-8 issues
Diffstat (limited to 'dw/hyphenator.cc')
-rw-r--r-- | dw/hyphenator.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dw/hyphenator.cc b/dw/hyphenator.cc index 4acee185..1c64c310 100644 --- a/dw/hyphenator.cc +++ b/dw/hyphenator.cc @@ -1,6 +1,7 @@ #include "hyphenator.hh" #include "../lout/misc.hh" +#include "../lout/unicode.hh" #include <stdio.h> #include <string.h> @@ -192,6 +193,7 @@ bool Hyphenator::isHyphenationCandidate (const char *word) */ bool Hyphenator::isCharPartOfActualWord (char *s) { +#if 0 // Return true when "s" points to a letter. return (s[0] >= 'a' && s[0] <= 'z') || // UTF-8: starts with 0xc3 @@ -200,6 +202,9 @@ bool Hyphenator::isCharPartOfActualWord (char *s) (unsigned char)s[1] == 0xb6 /* ö */ || (unsigned char)s[1] == 0xbc /* ü */ || (unsigned char)s[1] == 0x9f /* ß */ )); +#endif + + return lout::unicode::isAlpha (lout::unicode::decodeUtf8 (s)); } /** |