Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Encoding problem when using german umlaute in uri parameters

Armin Steudte
9 years ago Nov 20, 2013 3:29pm
Johannes Dahlström
9 years ago Nov 20, 2013 3:44pm
Armin Steudte
9 years ago Nov 21, 2013 6:59am
Armin Steudte
9 years ago Nov 21, 2013 7:34am
Armin Steudte
9 years ago Nov 22, 2013 8:11am
Frank Schmitz
8 years ago Aug 13, 2014 6:53am

Probably a bit too late but this worked for me:

tmpUsername = URLDecoder.decode(new String(paramsMap.get(URL_PARAM.USER_NAME).getBytes("iso-8859-1"),"UTF-8"), "UTF-8");
tmpPassword = URLDecoder.decode(new String(paramsMap.get(URL_PARAM.PASSWORD).getBytes("iso-8859-1"),"UTF-8"), "UTF-8");

However, to accept unecoded URIs is inherently dangerous. When you get a city with a "space" in the name (like "Bad Hersfeld" or similar) you will get a Vaadin 500 - com.vaadin.server.ServiceException: java.lang.RuntimeException: Invalid location URI received from client.

So best way would be to have the caller encode the URI correctly...

Hope that helps, Frank

Tsogtgerel Tsogtsaikhan
6 years ago Nov 15, 2016 3:57am
chanthorn srou
6 years ago Dec 09, 2016 8:57am
Arundev Puthenpurayil
3 years ago Aug 28, 2019 1:42pm