diff --git a/Doxyfile b/Doxyfile index 8ae089ea..8eabf0ef 100644 --- a/Doxyfile +++ b/Doxyfile @@ -120,7 +120,6 @@ FILTER_PATTERNS = FILTER_SOURCE_FILES = NO FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = -MODIFY_SPECIAL_CHARS = YES #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp index de29c535..54654004 100644 --- a/addon/doxyparse/doxyparse.cpp +++ b/addon/doxyparse/doxyparse.cpp @@ -425,7 +425,6 @@ int main(int argc,char **argv) { // check and finalize the configuration checkConfiguration(); - Config_getBool(MODIFY_SPECIAL_CHARS)=FALSE; adjustConfiguration(); // setup the non-default configuration options diff --git a/src/config.xml b/src/config.xml index 78d5fd68..fdc562d1 100644 --- a/src/config.xml +++ b/src/config.xml @@ -1562,14 +1562,6 @@ FILE_VERSION_FILTER = "cleartool desc -fmt \%Vn" is part of the input, its contents will be placed on the main page (`index.html`). This can be useful if you have a project on for instance GitHub and want to reuse the introduction page also for the doxygen output. -]]> - - - diff --git a/src/util.cpp b/src/util.cpp index 4bef4939..08c13fb4 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5442,112 +5442,104 @@ QCString escapeCharsInString(const char *name,bool allowDots,bool allowUnderscor { static bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES); static bool allowUnicodeNames = Config_getBool(ALLOW_UNICODE_NAMES); - static bool modifySpecialCharsInString = Config_getBool(MODIFY_SPECIAL_CHARS); static GrowBuf growBuf; growBuf.clear(); char c; const char *p=name; while ((c=*p++)!=0) { - if(modifySpecialCharsInString) + switch(c) { - switch(c) - { - case '_': if (allowUnderscore) growBuf.addChar('_'); else growBuf.addStr("__"); break; - case '-': growBuf.addChar('-'); break; - case ':': growBuf.addStr("_1"); break; - case '/': growBuf.addStr("_2"); break; - case '<': growBuf.addStr("_3"); break; - case '>': growBuf.addStr("_4"); break; - case '*': growBuf.addStr("_5"); break; - case '&': growBuf.addStr("_6"); break; - case '|': growBuf.addStr("_7"); break; - case '.': if (allowDots) growBuf.addChar('.'); else growBuf.addStr("_8"); break; - case '!': growBuf.addStr("_9"); break; - case ',': growBuf.addStr("_00"); break; - case ' ': growBuf.addStr("_01"); break; - case '{': growBuf.addStr("_02"); break; - case '}': growBuf.addStr("_03"); break; - case '?': growBuf.addStr("_04"); break; - case '^': growBuf.addStr("_05"); break; - case '%': growBuf.addStr("_06"); break; - case '(': growBuf.addStr("_07"); break; - case ')': growBuf.addStr("_08"); break; - case '+': growBuf.addStr("_09"); break; - case '=': growBuf.addStr("_0A"); break; - case '$': growBuf.addStr("_0B"); break; - case '\\': growBuf.addStr("_0C"); break; - case '@': growBuf.addStr("_0D"); break; - default: - if (c<0) + case '_': if (allowUnderscore) growBuf.addChar('_'); else growBuf.addStr("__"); break; + case '-': growBuf.addChar('-'); break; + case ':': growBuf.addStr("_1"); break; + case '/': growBuf.addStr("_2"); break; + case '<': growBuf.addStr("_3"); break; + case '>': growBuf.addStr("_4"); break; + case '*': growBuf.addStr("_5"); break; + case '&': growBuf.addStr("_6"); break; + case '|': growBuf.addStr("_7"); break; + case '.': if (allowDots) growBuf.addChar('.'); else growBuf.addStr("_8"); break; + case '!': growBuf.addStr("_9"); break; + case ',': growBuf.addStr("_00"); break; + case ' ': growBuf.addStr("_01"); break; + case '{': growBuf.addStr("_02"); break; + case '}': growBuf.addStr("_03"); break; + case '?': growBuf.addStr("_04"); break; + case '^': growBuf.addStr("_05"); break; + case '%': growBuf.addStr("_06"); break; + case '(': growBuf.addStr("_07"); break; + case ')': growBuf.addStr("_08"); break; + case '+': growBuf.addStr("_09"); break; + case '=': growBuf.addStr("_0A"); break; + case '$': growBuf.addStr("_0B"); break; + case '\\': growBuf.addStr("_0C"); break; + case '@': growBuf.addStr("_0D"); break; + default: + if (c<0) + { + char ids[5]; + const unsigned char uc = (unsigned char)c; + bool doEscape = TRUE; + if (allowUnicodeNames && uc <= 0xf7) { - char ids[5]; - const unsigned char uc = (unsigned char)c; - bool doEscape = TRUE; - if (allowUnicodeNames && uc <= 0xf7) + const char* pt = p; + ids[ 0 ] = c; + int l = 0; + if ((uc&0xE0)==0xC0) { - const char* pt = p; - ids[ 0 ] = c; - int l = 0; - if ((uc&0xE0)==0xC0) - { - l=2; // 11xx.xxxx: >=2 byte character - } - if ((uc&0xF0)==0xE0) - { - l=3; // 111x.xxxx: >=3 byte character - } - if ((uc&0xF8)==0xF0) - { - l=4; // 1111.xxxx: >=4 byte character - } - doEscape = l==0; - for (int m=1; m=2 byte character + } + if ((uc&0xF0)==0xE0) + { + l=3; // 111x.xxxx: >=3 byte character + } + if ((uc&0xF8)==0xF0) + { + l=4; // 1111.xxxx: >=4 byte character + } + doEscape = l==0; + for (int m=1; m>4]; - ids[3]=map[id&0xF]; - ids[4]=0; - growBuf.addStr(ids); + ids[ l ] = 0; + growBuf.addStr( ids ); + p += l - 1; } } - else if (caseSenseNames || !isupper(c)) - { - growBuf.addChar(c); - } - else + if (doEscape) // not a valid unicode char or escaping needed { - growBuf.addChar('_'); - growBuf.addChar(tolower(c)); + static char map[] = "0123456789ABCDEF"; + unsigned char id = (unsigned char)c; + ids[0]='_'; + ids[1]='x'; + ids[2]=map[id>>4]; + ids[3]=map[id&0xF]; + ids[4]=0; + growBuf.addStr(ids); } - break; - } - } - else - { - growBuf.addChar(c); + } + else if (caseSenseNames || !isupper(c)) + { + growBuf.addChar(c); + } + else + { + growBuf.addChar('_'); + growBuf.addChar(tolower(c)); + } + break; } } growBuf.addChar(0);