FIXED: Avoid that illegal UTF-8 input results in negative characters.
This can cause crashes.
Updated sgml