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

Encoding UTF-8 not well supported for jnlp(xml) file on Windows #190

Closed
douph1 opened this issue Apr 18, 2019 · 10 comments
Closed

Encoding UTF-8 not well supported for jnlp(xml) file on Windows #190

douph1 opened this issue Apr 18, 2019 · 10 comments
Labels
bug Something isn't working
Milestone

Comments

@douph1
Copy link
Contributor

douph1 commented Apr 18, 2019

I have some strange char on Windows into Desktop shortcut, Windows Menu and Splas screen due to somme non ascii char in jnlp

For the demo purpose I have added é è and à in some xml attribut
Sample jnlp:
https://apoweb-preprod-integration.phmd.net/preprod_integration/version.jnlp
This jnlp display a JFrame with java version information.

No content-type return by the web server:
< HTTP/1.1 200 OK
< Date: Thu, 18 Apr 2019 14:20:41 GMT
< Server: Apache-Coyote/1.1
< Accept-Ranges: bytes
< ETag: W/"759-1555596356000"
< Last-Modified: Thu, 18 Apr 2019 14:05:56 GMT
< Content-Type: application/x-java-jnlp-file
< Content-Length: 759

And jnlp file begin with UTF-8 : <?xml version="1.0" encoding="UTF-8"?>

 Desktop shorcut name create is called : Version title é (Version).lnk
Idem for StartUp menu : Uninstall Version title é.lnk

and we can see the accented char are not well displayed in Splas screen too

  • on the top of splash screen : Title Version title é
  • on the bottom : Version desc é

PS: on Linux, the Shorcut name is good ( with accent )

@douph1
Copy link
Contributor Author

douph1 commented Apr 18, 2019

just tried with Oracle jre1.8.0_201 wich handle desktop and startmenu file name correctly "Version title é"

@douph1
Copy link
Contributor Author

douph1 commented Apr 18, 2019

This has for effect to break clearing from shortcuts wich looking for file with utf-8 char but dont find it

[adminup][ITW-JAVAWS][WARNING_ALL][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.cache.CacheUtil.clearCache(CacheUtil.java:188)] NETX Thread# 5b480cf9, name main Clearing cache for: file:/C:/Users/adminup/Downloads/version.jnlp
[adminup][ITW-JAVAWS][MESSAGE_ALL][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.cache.CacheUtil.clearCache(CacheUtil.java:204)] NETX Thread# 5b480cf9, name main Alerting: 1 of files
[adminup][ITW-JAVAWS][MESSAGE_DEBUG][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.cache.CacheUtil$1.accept(CacheUtil.java:222)] NETX Thread# 5b480cf9, name main marked for deletion: C:\Users\adminup\.cache\icedtea-web\cache\1\https\apoweb-preprod-integration.phmd.net\preprod_integration\Version.jar.info
[adminup][ITW-JAVAWS][ERROR_DEBUG][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.cache.CacheUtil.removeWindowsShortcuts(CacheUtil.java:251)] NETX Thread# 5b480cf9, name main Clearing Windows shortcuts
[adminup][ITW-JAVAWS][MESSAGE_DEBUG][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.cache.CacheUtil.removeWindowsShortcuts(CacheUtil.java:272)] NETX Thread# 5b480cf9, name main Deleting item = C:\Users\adminup/Desktop/Version title é (Version).lnk
[adminup][ITW-JAVAWS][ERROR_DEBUG][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.util.FileUtils.recursiveDelete(FileUtils.java:518)] NETX Thread# 5b480cf9, name main Deleting: C:\Users\adminup\Desktop\Version title é (Version).lnk
[adminup][ITW-JAVAWS][ERROR_DEBUG][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.cache.CacheUtil.removeWindowsShortcuts(CacheUtil.java:277)] NETX Thread# 5b480cf9, name main
java.io.IOException: Unable to delete file: C:\Users\adminup\Desktop\Version title é (Version).lnk
	at net.sourceforge.jnlp.util.FileUtils.recursiveDelete(FileUtils.java:532)
	at net.sourceforge.jnlp.cache.CacheUtil.removeWindowsShortcuts(CacheUtil.java:275)
	at net.sourceforge.jnlp.cache.CacheUtil.clearCache(CacheUtil.java:228)
	at net.sourceforge.jnlp.runtime.Boot.init(Boot.java:373)
	at net.sourceforge.jnlp.runtime.JnlpBoot.run(JnlpBoot.java:58)
	at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:270)
	at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:63)
	at java.security.AccessController.doPrivileged(Native Method)
	at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:210)
[adminup][ITW-JAVAWS][MESSAGE_DEBUG][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.cache.CacheUtil.removeWindowsShortcuts(CacheUtil.java:272)] NETX Thread# 5b480cf9, name main Deleting item = C:\Users\adminup/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Version menu à/Version title é.lnk
[adminup][ITW-JAVAWS][ERROR_DEBUG][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.util.FileUtils.recursiveDelete(FileUtils.java:518)] NETX Thread# 5b480cf9, name main Deleting: C:\Users\adminup\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Version menu à\Version title é.lnk
[adminup][ITW-JAVAWS][ERROR_DEBUG][Thu Apr 18 17:19:11 CEST 2019][net.sourceforge.jnlp.cache.CacheUtil.removeWindowsShortcuts(CacheUtil.java:277)] NETX Thread# 5b480cf9, name main
java.io.IOException: Unable to delete file: C:\Users\adminup\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Version menu à\Version title é.lnk
	at net.sourceforge.jnlp.util.FileUtils.recursiveDelete(FileUtils.java:532)
	at net.sourceforge.jnlp.cache.CacheUtil.removeWindowsShortcuts(CacheUtil.java:275)
	at net.sourceforge.jnlp.cache.CacheUtil.clearCache(CacheUtil.java:228)
	at net.sourceforge.jnlp.runtime.Boot.init(Boot.java:373)
	at net.sourceforge.jnlp.runtime.JnlpBoot.run(JnlpBoot.java:58)
	at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:270)
	at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:63)
	at java.security.AccessController.doPrivileged(Native Method)
	at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:210)

@douph1 douph1 changed the title Is encoding UTF-8 supported for jnlp(xml) file on Windows ? Encoding UTF-8 not well supported for jnlp(xml) file on Windows Apr 18, 2019
@karianna karianna added this to the 2.0.x milestone Apr 18, 2019
@karianna karianna added the bug Something isn't working label Apr 18, 2019
@judovana
Copy link
Contributor

judovana commented May 2, 2019

It do not look right - the jnlp file vendor looks weird:
Version desc è
...

e and a ? Really?

Maybe server is changing the encoding on the fly. Generally if there is any other encoding then utf8 anywhere in Icedtea-web code, then it is wrong.

@douph1
Copy link
Contributor Author

douph1 commented May 2, 2019

It do not look right - the jnlp file vendor looks weird:

Yes, the file is weird voluntarily (accent letters) to show that UTF-8 char are not handled properly
as said

For the demo purpose I have added é è and à in some xml attribut

Maybe server is changing the encoding on the fly.

No
Try to detect encoding with "file" on unix

doussot@PC-TEC-12:~$ curl -s https://apoweb-preprod-integration.phmd.net/preprod_integration/version.jnlp | grep "title" | file -
/dev/stdin: HTML document, UTF-8 Unicode text
doussot@PC-TEC-12:~$ curl -s https://apoweb-preprod-integration.phmd.net/preprod_integration/version.jnlp | grep "submenu" | file -
/dev/stdin: UTF-8 Unicode text
doussot@PC-TEC-12:~$ curl -s https://apoweb-preprod-integration.phmd.net/preprod_integration/version.jnlp | grep description | file -
/dev/stdin: UTF-8 Unicode text

and you can read http header too, it dont indicate any encoding

Content-Type: application/x-java-jnlp-file

@janakmulani
Copy link
Contributor

janakmulani commented Feb 26, 2020

Played around a bit with the jnlp file on windows and found that the characters you see depend on the encoding used when saving the jnlp file on your machine. On my windows machine I start your app using the URL https://apoweb-preprod-integration.phmd.net/preprod_integration/version.jnlp. On my machine version.jnlp is saved in UTF-8 format and I see the proper name with accented character for Desktop Icon and start menu entry.
DesktopIcon

However, if I open the jnlp file and save it after encoding it in ANSI and removing the href (so that it will not download the jnlp file from server)
VersionJnlpANSI

then I get the funny character in desktop Icon :

DesktopIcon-ANSI

@Jamila891
Copy link

@douph1 did the last message help you to solve the problem? If yes, we would close this issue.

@douph1
Copy link
Contributor Author

douph1 commented Sep 21, 2020

I had saved it correctly in UTF-8 (vim linux user here).
Has you as seen, "file" command confirmed this was utf-8
I will try one more time.

@douph1
Copy link
Contributor Author

douph1 commented Sep 21, 2020

see the original sample
version.jnlp.txt

@douph1
Copy link
Contributor Author

douph1 commented Sep 22, 2020

Just trying with latest OpenJDK8U-jdk_x64_windows_hotspot_8u265b01.msi bundled with icedtea1.8.3 .. same : accent broken
OpenWebStart 1.2.1 : encoding correct
openwebstart_1 2 1

and same for Start Menu
start_menu

Is OpenWebStart 1.2.1 bundled from master branch (aka pre 2.0.0 , maybe 2.0.0-alpha15 tag ) ?
If yes, does an encoding fix was made part of IcedTea or OpenWebStart ?

@douph1
Copy link
Contributor Author

douph1 commented Sep 22, 2020

Just tested master branch and the encoding bug seems fixed for the next 2.0.0

@douph1 douph1 closed this as completed Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants