Page 1 of 1

Search is not working with Russian locale strings

PostPosted: Wed May 25, 2011 12:52 am
by mastermav
Search from main web page cannot find anything if I type query with Russian characters.

I discovered that index file is produced incorrectly, '?' instead of real letters, instead of using UTF-8 encoding or similar, file is produced with local codepage encoding which cannot represent whole set of Unicode characters. I also have few mp3's which named using other non-english characters, Chinese and Japanese. Search does not work for those as well.

Do I need to fix something in the configuration? Or the source code has to be modified to fix that issue?

I use Subsonic v4.4 (build 2172) server on Windows.

subsonic13.index file fragment
[..]
F ixYxi 1230318331484 ixYxi 1230318331484 ixYxi D:\shares\Music\Russian\????-??????? - ?? ??????????? ????? ???????\07-solnce_vzoidet_256_lame_cbr.mp3 ixYxi 7402755 ixYxi ????-??????? ixYxi ?? ??????????? ????? ??????? ixYxi ?????? ??????? ixYxi 1995 ixYxi Other
F ixYxi 1230317584328 ixYxi 1230317584328 ixYxi D:\shares\Music\Russian\????-??????? - ?? ??????????? ????? ???????\08-apachi_(indeiskie_dubi)_256_lame_cbr.mp3 ixYxi 6637070 ixYxi ????-??????? ixYxi ?? ??????????? ????? ??????? ixYxi ????? (????????? ????) ixYxi 1995 ixYxi Other
[..]

PostPosted: Wed May 25, 2011 11:36 pm
by mastermav
So I went through the code and I think I found a fix for that. Unfortunately, I have no java installed, cannot compile, and test it. Would anyone from the developers run this through?

/subsonic-main/src/main/java/net/sourceforge/subsonic/service/SearchService.java
Replace:
writer = new PrintWriter(new FileWriter(getIndexFile()));
with
writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(getIndexFile()), "UTF8"));

BufferedReader reader = new BufferedReader(new FileReader(getIndexFile()));
With
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(getIndexFile()), "UTF8"));

private static final int INDEX_VERSION = 13;
with
private static final int INDEX_VERSION = 14;

PostPosted: Mon Jun 27, 2011 2:03 pm
by ppxlnt
I have the same problem with 4.3 for Windows. Songs with Chinese folders and file names are displayed correctly. But they cannot be searched.

Have someone managed to get search work?