java - When uploading Arabic files in Spring, filename ends up with XML entities instead of Arabic glyphs -


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 this:

  & amp; # 1575; & Amp; # 1604; & Amp; # 1605; & Amp; # 1594; & Amp; # 1601; & Amp; # 1604; & Amp; # 1610; & Amp; # 1606; PNG  

I hope this will be:

المغفلين .png

Any idea why this problem it occurs?

This is the spring which has changed the Unicode characters (at least, non-ISO-8859- 1 character) In XML entities, this behavior should be configured in Spring Settings (or anywhere in the web based MVC framework that you are actually using in conjunction with Spring but not mentioned it). Since I do not spring, I can not go into detail about configuring it.

But if you can not understand it forever, then you can manually use XML units in real ARB glyph for use in real Arabic glyphs.

  string realFilename = StringEscapeUtils unescapeXml (escapedFilename);  

Comments