diff --git a/src/util/css_const.h.in b/src/util/css_const.h.in index a1803c7..1e9f1aa 100644 --- a/src/util/css_const.h.in +++ b/src/util/css_const.h.in @@ -1,4 +1,4 @@ -/* vim: filetype=cpp : */ +/* vim: set filetype=cpp : */ /* * css_const.h * diff --git a/src/util/unicode.cc b/src/util/unicode.cc index 7e047b6..e7c96ee 100644 --- a/src/util/unicode.cc +++ b/src/util/unicode.cc @@ -17,7 +17,12 @@ using std::cerr; using std::endl; using std::ostream; -/* Test legal for HTML */ +/* + * Test legal for HTML + * + * A legal unicode character should be accepted by browsers, and displayed correctly. + * This function is not complete, just to be improved. + */ bool isLegalUnicode(Unicode u) { /* @@ -47,6 +52,13 @@ bool isLegalUnicode(Unicode u) if((u >= 127) && (u <= 160)) return false; + /* + * 173, or 0xad, is the soft hyphen + * which can be ignored by the browser in the middle of a line + */ + if(u == 173) + return false; + if((u >= 0xd800) && (u <= 0xdfff)) return false;