diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-03-22 19:02:06 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-03-22 19:02:06 (GMT) |
commit | a4ecbee86766b35d25d41d1a178806e1688485df (patch) | |
tree | 0cb08f45ced6dd4ed97188972c5a718c94219d46 /src/markdown.cpp | |
parent | fa1897b1889f7bf74de68f1ac99cf3be343a7551 (diff) | |
download | Doxygen-a4ecbee86766b35d25d41d1a178806e1688485df.zip Doxygen-a4ecbee86766b35d25d41d1a178806e1688485df.tar.gz Doxygen-a4ecbee86766b35d25d41d1a178806e1688485df.tar.bz2 |
issue #8375: Lowercase search does not find non-ASCII uppercase pages and vice versa
Diffstat (limited to 'src/markdown.cpp')
-rw-r--r-- | src/markdown.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/markdown.cpp b/src/markdown.cpp index ceba79d..277777a 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -50,6 +50,7 @@ #include "portable.h" #include "regex.h" #include "fileinfo.h" +#include "utf8.h" #if !defined(NDEBUG) #define ENABLE_TRACING @@ -2657,23 +2658,21 @@ QCString Markdown::detab(const QCString &s,int &refIndent) if (c<0 && i<size) // multibyte sequence { // special handling of the UTF-8 nbsp character 0xC2 0xA0 - if ((uchar)c == 0xC2 && (uchar)(data[i]) == 0xA0) + int nb = isUTF8NonBreakableSpace(data); + if (nb>0) { m_out.addStr(g_doxy_nsbp); - i++; + i+=nb-1; } else { - m_out.addChar(c); - m_out.addChar(data[i++]); // >= 2 bytes - if (((uchar)c&0xE0)==0xE0 && i<size) - { - m_out.addChar(data[i++]); // 3 bytes - } - if (((uchar)c&0xF0)==0xF0 && i<size) + int bytes = getUTF8CharNumBytes(c); + for (int j=0;j<bytes-1 && c;j++) { - m_out.addChar(data[i++]); // 4 byres + m_out.addChar(c); + c = data[i++]; } + m_out.addChar(c); } } else |