Search is not working with Russian locale strings

Need help? Post your questions here.

Moderator: moderators

Search is not working with Russian locale strings

Postby mastermav » Wed May 25, 2011 12:52 am

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
[..]
mastermav
 
Posts: 2
Joined: Wed May 25, 2011 12:39 am

Postby mastermav » Wed May 25, 2011 11:36 pm

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;
mastermav
 
Posts: 2
Joined: Wed May 25, 2011 12:39 am

Postby ppxlnt » Mon Jun 27, 2011 2:03 pm

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?
ppxlnt
 
Posts: 1
Joined: Mon Jun 27, 2011 1:58 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 34 guests