Merge pull request #86 from odz/chardet

Add encoding detection
This commit is contained in:
Naoki Takezoe
2013-08-23 21:24:41 -07:00
4 changed files with 20 additions and 7 deletions

View File

@@ -64,7 +64,7 @@ trait RepositorySearchService { self: IssuesService =>
if(treeWalk.getFileMode(0) != FileMode.TREE){
JGitUtil.getContent(git, treeWalk.getObjectId(0), false).foreach { bytes =>
if(FileUtil.isText(bytes)){
val text = new String(bytes, "UTF-8")
val text = StringUtil.convertFromByteArray(bytes)
val lowerText = text.toLowerCase
val indices = keywords.map(lowerText.indexOf _)
if(!indices.exists(_ < 0)){