I am using Spring upload to upload files. When uploading an Arabic file and getting the original file name in the controller, I get something like:
المغفلين.png
I expect it to be:
المغفلين.png
Any ideas why this problem occur?
It’s likely Spring which has transformed Unicode characters (at least, the non-ISO-8859-1 characters) into XML entities. This behaviour must be configureable somewhere in the Spring settings (or those of the web based MVC framework you’re actually using in combination with Spring but didn’t mention about). Since I don’t do Spring, I can’t go in detail about configuring this.
But if you can’t figure it for ever, then you may consider to use Apache Commons Lang
StringEscapeUtils#unescapeXml()to manually unescape the XML entities into real Arabic glyphs.