Commit bca6baee authored by Dimitri van Heesch's avatar Dimitri van Heesch
Browse files

Bug 705910 - Indexing and searching cannot treat non ASCII identifiers

parent f6bc941e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -174,7 +174,7 @@ QHP_SECT_FILTER_ATTRS =
QHG_LOCATION           =
QHG_LOCATION           =
GENERATE_ECLIPSEHELP   = YES
GENERATE_ECLIPSEHELP   = YES
ECLIPSE_DOC_ID         = org.doxygen.qtools
ECLIPSE_DOC_ID         = org.doxygen.qtools
DISABLE_INDEX          = YES
DISABLE_INDEX          = NO
GENERATE_TREEVIEW      = YES
GENERATE_TREEVIEW      = YES
ENUM_VALUES_PER_LINE   = 4
ENUM_VALUES_PER_LINE   = 4
TREEVIEW_WIDTH         = 250
TREEVIEW_WIDTH         = 250
+383 −523

File changed.

Preview size limit exceeded, changes collapsed.

+7 −9
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@ function convertToId(search)
  {
  {
    var c = search.charAt(i);
    var c = search.charAt(i);
    var cn = c.charCodeAt(0);
    var cn = c.charCodeAt(0);
    if (c.match(/[a-z0-9]/))
    if (c.match(/[a-z0-9\u0080-\uFFFF]/))
    {
    {
      result+=c;
      result+=c;
    }
    }
@@ -310,22 +310,20 @@ function SearchBox(name, resultsPath, inFrame, label)
    var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
    var searchValue = this.DOMSearchField().value.replace(/^ +/, "");


    var code = searchValue.toLowerCase().charCodeAt(0);
    var code = searchValue.toLowerCase().charCodeAt(0);
    var hexCode;
    var idxChar = searchValue.substr(0, 1).toLowerCase();
    if (code<16) 
    if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair
    {
    {
      hexCode="0"+code.toString(16);
      idxChar = searchValue.substr(0, 2);
    }
    else 
    {
      hexCode=code.toString(16);
    }
    }


    var resultsPage;
    var resultsPage;
    var resultsPageWithSearch;
    var resultsPageWithSearch;
    var hasResultsPage;
    var hasResultsPage;


    if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1')
    var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar);
    if (idx!=-1)
    {
    {
       var hexCode=idx.toString(16);
       resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
       resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
       resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
       resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
       hasResultsPage = true;
       hasResultsPage = true;
+1 −1
Original line number Original line Diff line number Diff line
@@ -358,7 +358,7 @@ function main()
  $sorted = run_query($query);
  $sorted = run_query($query);
  // Now output the HTML stuff...
  // Now output the HTML stuff...
  // End the HTML form
  // End the HTML form
  end_form(preg_replace("/[^a-zA-Z0-9\-\_\.]/i", " ", $query ));
  end_form(preg_replace("/[^a-zA-Z0-9\-\_\.\x80-\xFF]/i", " ", $query ));
  // report results to the user
  // report results to the user
  report_results($sorted);
  report_results($sorted);
  end_page();
  end_page();
+1 −1
Original line number Original line Diff line number Diff line
@@ -358,7 +358,7 @@
"  $sorted = run_query($query);\n"
"  $sorted = run_query($query);\n"
"  // Now output the HTML stuff...\n"
"  // Now output the HTML stuff...\n"
"  // End the HTML form\n"
"  // End the HTML form\n"
"  end_form(preg_replace(\"/[^a-zA-Z0-9\\-\\_\\.]/i\", \" \", $query ));\n"
"  end_form(preg_replace(\"/[^a-zA-Z0-9\\-\\_\\.\\x80-\\xFF]/i\", \" \", $query ));\n"
"  // report results to the user\n"
"  // report results to the user\n"
"  report_results($sorted);\n"
"  report_results($sorted);\n"
"  end_page();\n"
"  end_page();\n"
Loading