flyson
flyso****@users*****
2005年 12月 4日 (日) 01:00:31 JST
Index: bbs2chreader/content/bbs2chreader/board-items.js diff -u bbs2chreader/content/bbs2chreader/board-items.js:1.12 bbs2chreader/content/bbs2chreader/board-items.js:1.13 --- bbs2chreader/content/bbs2chreader/board-items.js:1.12 Sun Nov 13 04:13:16 2005 +++ bbs2chreader/content/bbs2chreader/board-items.js Sun Dec 4 01:00:31 2005 @@ -258,7 +258,6 @@ this._items.push(logItemHash[i]); } } - dump("Bbs2chBoardItems.refresh : "+ (new Date().getTime() - startTime) +"ms\n"); }, @@ -356,12 +355,21 @@ search: function(aSearchString){ if(!this._lastItems) this._lastItems = this.items.concat(); - aSearchString = aSearchString.toLowerCase(); - + + var unicodeNormalizer = Components.classes["@mozilla.org/intl/unicodenormalizer;1"] + .createInstance(Components.interfaces.nsIUnicodeNormalizer); + var normalizedStr = {}; + + var searchString = aSearchString.toLowerCase(); + unicodeNormalizer.NormalizeUnicodeNFKC(searchString, normalizedStr); + searchString = normalizedStr.value; + var resultItems = new Array(); for(var i=0; i<this._lastItems.length; i++){ - var title = this._lastItems[i].title.toLowerCase();; - if(title.indexOf(aSearchString) != -1) + var title = this._lastItems[i].title.toLowerCase(); + unicodeNormalizer.NormalizeUnicodeNFKC(title, normalizedStr); + title = normalizedStr.value; + if(title.indexOf(searchString) != -1) resultItems.push(this._lastItems[i]); } return this._items = resultItems;