benchdoos/WeblocOpener

Fail to recognize file path with chinese characters

LeeTeng2001 opened this issue · 17 comments

When I try to open a webloc link in a path that contains chinese characters it'll fail, the log output is as following:

2022-05-30 19:54:17,366 INFO c.g.b.w.u.Logging:61 [main] - Logging successfully started. Welcome to WeblocOpener v.1.11.1.333
2022-05-30 19:54:17,366 INFO c.g.b.w.u.s.SystemUtils:64 [main] - Initializing system...
2022-05-30 19:54:17,366 INFO c.g.b.w.u.s.SystemUtils:67 [main] - System: OS: Windows 8.1 6.3 x64 Processors: 20 JVM memory: 7232 MB (free:450 MB) Java v.1.8(1.8.0_51) runtime v.25.51-b03
2022-05-30 19:54:17,366 INFO c.g.b.w.c.Application:57 [main] - WeblocOpener starts in mode: WEBLOCOPENER
2022-05-30 19:54:17,366 INFO c.g.b.w.c.Application:58 [main] - WeblocOpener starts with arguments: [C:\Users\PC\OneDrive - sjtu.edu.cn\2021 ?? 2\CS2308 ??????\Algorithm and Complexity (2022) Website.webloc]
2022-05-30 19:54:17,429 INFO c.g.b.w.c.Application:91 [main] - Got args: [C:\Users\PC\OneDrive - sjtu.edu.cn\2021 ?? 2\CS2308 ??????\Algorithm and Complexity (2022) Website.webloc]
2022-05-30 19:54:17,429 INFO c.g.b.w.c.Application:349 [main] - Updates were checked less then 24h ago
2022-05-30 19:54:17,429 INFO c.g.b.w.s.DefaultAnalyzer:173 [main] - File [C:\Users\PC\OneDrive - sjtu.edu.cn\2021 ?? 2\CS2308 ??????\Algorithm and Complexity (2022) Website.webloc] exists: false file?: false
2022-05-30 19:54:17,429 WARN c.g.b.w.s.DefaultAnalyzer:184 [main] - Wrong argument. Invalid file path or file not exist: C:\Users\PC\OneDrive - sjtu.edu.cn\2021 ?? 2\CS2308 ??????\Algorithm and Complexity (2022) Website.webloc
2022-05-30 19:54:17,429 INFO c.g.b.w.s.DefaultAnalyzer:185 [main] - Trying to guess what file user wants to open
2022-05-30 19:54:17,429 INFO c.g.b.w.s.DefaultAnalyzer:187 [main] - Got files, that match: null
2022-05-30 19:54:17,429 WARN c.g.b.w.c.Application:171 [main] - Could not open file: C:\Users\PC\OneDrive - sjtu.edu.cn\2021 ?? 2\CS2308 ??????\Algorithm and Complexity (2022) Website.webloc
java.io.FileNotFoundException: Can not analyze file: C:\Users\PC\OneDrive - sjtu.edu.cn\2021 ?? 2\CS2308 ??????\Algorithm and Complexity (2022) Website.webloc
at com.github.benchdoos.weblocopener.service.DefaultAnalyzer.analyzeFile(DefaultAnalyzer.java:105) ~[WeblocOpener.exe:?]
at com.github.benchdoos.weblocopener.service.DefaultAnalyzer.(DefaultAnalyzer.java:52) ~[WeblocOpener.exe:?]
at com.github.benchdoos.weblocopener.core.Application.runAnalyzer(Application.java:164) [WeblocOpener.exe:?]
at com.github.benchdoos.weblocopener.core.Application.manageArguments(Application.java:150) [WeblocOpener.exe:?]
at com.github.benchdoos.weblocopener.core.Application.manageSoloArgument(Application.java:355) [WeblocOpener.exe:?]
at com.github.benchdoos.weblocopener.core.Application.(Application.java:67) [WeblocOpener.exe:?]
at com.github.benchdoos.weblocopener.Main.(Main.java:46) [WeblocOpener.exe:?]
at com.github.benchdoos.weblocopener.Main.main(Main.java:72) [WeblocOpener.exe:?]
2022-05-30 19:55:39,464 INFO c.g.b.w.u.Logging:61 [main] - Logging successfully started. Welcome to WeblocOpener v.1.11.1.333

As you can see, the chinese character has been substituted with ????

Can you provide some examples of path or filenames that app does not recognize?
Had a try to fix this issue and recent time hadn't find out how to do that(
This issue appears when cmd locale differs from unicode (and by default it does). You can see it on cmd-right click-preprties:

image

The path I'm trying to open is: "C:\Users\PC\OneDrive - sjtu.edu.cn\2021 大二 2\CS2308 算法与复杂性\Algorithm and Complexity (2022) Website.webloc"

c

Can you provide some examples of path or filenames that app does not recognize? Had a try to fix this issue and recent time hadn't find out how to do that( This issue appears when cmd locale differs from unicode (and by default it does). You can see it on cmd-right click-preprties:

image

I don't see this setting, I'm using Window 11

I don't see this setting, I'm using Window 11

Probably changed UI, didn't check this system yet.

The path I'm trying to open is: "C:\Users\PC\OneDrive - sjtu.edu.cn\2021 大二 2\CS2308 算法与复杂性\Algorithm and Complexity (2022) Website.webloc"

Thanks for example, I'll try to reproduce and to fix it.

Seems I've found solution. Will be fixed in v2.0.0

After regress testing found out that bug still reproducible.
Reason is launch4j wrapper: registered an issue - https://sourceforge.net/p/launch4j/bugs/229/
As an idea if it would not be fixed soon - create drag-and-drop window if file is not found to let user just drop it on the window and previous selected operation will be performed on all given files.
OR
turning back the file seeker that was working in previous versions of WeblocOpener to seek files through file system

Any of this solutions looks pretty bad... I guess next step is to look for another wrapper that has no such a problem

OR
calling jar without wrapping through cmd in hidden mode... if it is possible
Anyway will find it out in v2.0.0-beta1

WeblocOpener v2.0.0-beta.6 will have modernized algorithm to get file that was selected.
Launch4j gives no info about terms, so using algorithm until this problem will not be fixed.

WeblocOpener v2.0.0 beta.6 is available now.
@LeeTeng2001 can you test please, if the problem is fixed?

ok I'll test today and let you know

Why do I need jdk 17? I ady have openjdk 19 insttalled but it's not being recognised?

Why do I need jdk 17? I ady have openjdk 19 insttalled but it's not being recognised?

You can use jdk 19 as well. But I’m not sure that openjdk didn’t cut off Java swing support.
At least I’ve tested openjdk 17 and they did…

Why do I need jdk 17? I ady have openjdk 19 insttalled but it's not being recognised?

Do you have any problems via app installing or launching?

@LeeTeng2001 Sorry, did you have any problems with installing or launching WebloOpener on Java 19?

Hi, so far it's working fine !

Hello, @LeeTeng2001! WeblocOpener 2 is available now! You can try it out, if the issue is not reproducing, I guess issue can be closed.
Otherwise will research if there are any updates in used libs

Issue closed. Seems to be fixed. If the problems will appear again - create a new issue.