summaryrefslogtreecommitdiffstats
path: root/src/caseconvert.py
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-03-24 19:34:50 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-03-24 19:34:50 (GMT)
commit3a365ab230cab40910366eee5352534719541598 (patch)
treef0d5b60a05af6f1a440f02098951db6eca6a0fc0 /src/caseconvert.py
parentb4d7ed48ba6b44d5269fd69517535b4b91eb3f8a (diff)
downloadDoxygen-3a365ab230cab40910366eee5352534719541598.zip
Doxygen-3a365ab230cab40910366eee5352534719541598.tar.gz
Doxygen-3a365ab230cab40910366eee5352534719541598.tar.bz2
issue #8375 Lowercase search does not find non-ASCII uppercase pages and vice versa (part 2)
Diffstat (limited to 'src/caseconvert.py')
-rw-r--r--src/caseconvert.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/caseconvert.py b/src/caseconvert.py
index 0b0b57b..ef7e403 100644
--- a/src/caseconvert.py
+++ b/src/caseconvert.py
@@ -10,10 +10,10 @@ tolower = {}
def writeMapping(file,mapping):
for k,v in sorted(mapping.items()):
- file.write(u" case %s /* %s */: return u8\"%s\" /* %s */;\n" %
- (hex(ord(k[0])),k,v,",".join("0x{:02x}".format(ord(c)) for c in v)))
+ file.write(u" case %s /* %s */: BSEQ(%s) /* %s */;\n" %
+ (hex(ord(k[0])), k, ",".join(f"0x{b:02x}" for b in v.encode('utf-8')), v))
-# create mappings of characters whose upper and lower case differs
+# create mappings of characters whose upper and lower case differ
for codeValue in range(0,0x1FFFF):
s = chr(codeValue)
sl = s.lower()
@@ -32,6 +32,9 @@ file.write(r'''/** This file is generated by python3 caseconvert.py. DO NOT EDIT
#include <cstdint>
#include <string>
+#define BSEQ(...) { static unsigned char s[] = { __VA_ARGS__, 0x00 }; \
+ return reinterpret_cast<const char *>(s); }
+
inline const char *convertUnicodeToUpper(uint32_t code)
{
switch(code)