mirror of
https://github.com/fltk/fltk.git
synced 2026-06-03 22:17:12 +08:00
Fluid: Fix include guard between 0 and 127
if the UCS is not a number or letter
This commit is contained in:
@@ -659,12 +659,12 @@ int Code_Writer::write_code(const char *s, const char *t, bool to_codeview) {
|
|||||||
macro_name << '_';
|
macro_name << '_';
|
||||||
while (a < b) {
|
while (a < b) {
|
||||||
ucs = fl_utf8decode(a, b, &len);
|
ucs = fl_utf8decode(a, b, &len);
|
||||||
if ((ucs == '.') || (ucs == '_')) {
|
if (ucs > 0x0000ffff) { // large unicode character
|
||||||
macro_name << '_';
|
|
||||||
} else if (ucs > 0x0000ffff) { // large unicode character
|
|
||||||
macro_name << "\\U" << std::setw(8) << std::setfill('0') << std::hex << ucs;
|
macro_name << "\\U" << std::setw(8) << std::setfill('0') << std::hex << ucs;
|
||||||
} else if ((ucs > 127) || !isalnum(ucs)) { // small unicode character or not an ASCI letter or digit
|
} else if (ucs > 127) { // small unicode character or not an ASCI letter or digit
|
||||||
macro_name << "\\u" << std::setw(4) << std::setfill('0') << std::hex << ucs;
|
macro_name << "\\u" << std::setw(4) << std::setfill('0') << std::hex << ucs;
|
||||||
|
} else if (!isalnum(ucs)) {
|
||||||
|
macro_name << '_';
|
||||||
} else {
|
} else {
|
||||||
macro_name << (char)ucs;
|
macro_name << (char)ucs;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user