WeblocOpener icon indicating copy to clipboard operation
WeblocOpener copied to clipboard

Fail to recognize file path with chinese characters

Open LeeTeng2001 opened this issue 3 years ago • 5 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 ????

LeeTeng2001 avatar May 30 '22 11:05 LeeTeng2001

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

benchdoos avatar May 30 '22 15:05 benchdoos

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

LeeTeng2001 avatar May 31 '22 00:05 LeeTeng2001

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

LeeTeng2001 avatar May 31 '22 00:05 LeeTeng2001

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.

benchdoos avatar May 31 '22 16:05 benchdoos

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

benchdoos avatar Jun 03 '22 19:06 benchdoos

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

benchdoos avatar Feb 08 '23 16:02 benchdoos

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

benchdoos avatar Feb 08 '23 16:02 benchdoos

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.

benchdoos avatar Mar 02 '23 20:03 benchdoos

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

benchdoos avatar Mar 06 '23 18:03 benchdoos

ok I'll test today and let you know

LeeTeng2001 avatar Mar 07 '23 01:03 LeeTeng2001

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

LeeTeng2001 avatar Mar 07 '23 05:03 LeeTeng2001

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…

benchdoos avatar Mar 07 '23 06:03 benchdoos

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?

benchdoos avatar Mar 07 '23 08:03 benchdoos

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

benchdoos avatar Mar 22 '23 16:03 benchdoos

Hi, so far it's working fine !

LeeTeng2001 avatar Mar 23 '23 03:03 LeeTeng2001

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

benchdoos avatar Oct 16 '23 17:10 benchdoos

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

benchdoos avatar Nov 05 '23 20:11 benchdoos