Add encoding detection

This commit is contained in:
odz
2013-08-24 00:54:40 +09:00
parent 6d76e93ede
commit 13578dcee8
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)){