Solution for "InvalidPathException: Malformed input" in Tomcat
Today I came across the following Java Exception within Tomcat Web Application:
"java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters."
This is due to file system not able to handle special characters in a file name, e.g. Tromsø.png
The solution to this issue is actually quite simple. Set the system language to be UTF8 using the following code:
export LANG = en_US.UTF8
Then restart Tomcat. Now Tomcat should pick up the system property and set the file.encode to be UTF8.