Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST Api Parser does not find a file if there is an accent in its name #1849

Open
Bouhmarc opened this issue Jan 21, 2017 · 2 comments
Open
Assignees
Milestone

Comments

@Bouhmarc
Copy link

Hi

I used the parse api with this encoding :
http://192.168.0.18:9090/services/rest/parser?path=%2Fusr%2Fshare%2FDocuments%2F2016%2FPr%C3%AAtAltea.pdf

My file has an accent in its name.
I receive an error from the parser which is :
java.io.FileNotFoundException: /usr/share/Documents/2016/PrêtAltea.pdf (No such file or directory) - /usr/share/Documents/2016/PrêtAltea.pdf (No such file or directory) - com.jaeksoft.searchlib.webservice.parser.ParserImpl.putMagic(ParserImpl.java:203)

if i delete the accented character from the name, it works.
Is there any option to activate or is it a bug ?

thanks

Marc

@Bouhmarc
Copy link
Author

Hi everybody,

I answer to myself,
The only thing to do, is to select the right language in start.sh script

Instead of en_US.UTF_8, i put fr_FR.UTF_8, so accents will exists in the charset.

Maybe there is a more "reliable" solution instead of hardcode a language..
But that worked for me...

Thanks

Marc

@emmanuel-keller emmanuel-keller added this to the v1.5.15 milestone Apr 18, 2017
@emmanuel-keller emmanuel-keller self-assigned this Apr 18, 2017
@emmanuel-keller
Copy link
Member

Hi Marc,

First, thanks for the workaround.

I've read some interesting Q&A issues:

http://stackoverflow.com/questions/3072376/how-can-i-open-files-containing-accents-in-java
http://jonisalonen.com/2012/java-and-file-names-with-invalid-characters/
http://stackoverflow.com/questions/12109520/java-cant-see-file-on-file-system-that-contains-illegal-characters

I think that one interesting suggestion would be to move to java.nio. I currently investigate this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants