Encoding filenames in java

1
We encounter some issues with handling (preparing outgoing) email attachments (read: filedocuments) with names that contain Cyrillic characters. The java code (part of the exchange integration module) uses: name = URLEncoder.encode( name, "UTF-8"); From java documentation (exactly what happens in our case): For example using UTF-8 as the encoding scheme the string “The string ü@foo-bar” would get converted to “The+string+%C3%BC%40foo-bar” because in UTF-8 the character ü is encoded as two bytes C3 (hex) and BC (hex), and the character @ is encoded as one byte 40 (hex). In our case the email recipient sees (in outlook) the email attachment with a filename: The+string+%C3%BC%40foo-bar instead of The string ü@foo-bar When sending an email with outlook with the same attachments it does work properly. We want the attachments received by the recipients of the emails to see the proper filenames. How to resolve this issue? EDIT: The URLEncoder is causing the issue (part of the Exchange integration appstore module). The support department of the ewsj library indicates that the filename should not be encoded (since it will cause issue like this). Removing the encoding doesn't seem to do any harm (after first tests) while it does resolve the issue. Maybe appstore module should be updated as well.
asked
1 answers
0

IMHO it should be an escape function instead of encode.

answered