Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Java File upload with utf-8 chracters in name

CMC Consulting September 28, 2020

My upload code via Java Api works fine, but when file name contains characters like german umlaut and trying to post file with that name, in jira shows like ???

Tried to upload file with PostMan and file name was correct. copied missing header values from it but no luck.
Does anyone had same problem with Java, Spring?

Thanks

1 answer

0 votes
Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 28, 2020

Are saying the name contains UTF-8 characters, like "test-äöü" or the UTF-8 characters in the name have been converted to their ASCII equivalent, like "test-%C3%A4%C3%B6%C3%BC"?

Have you tried converting all UTF-8 in the name to ASCII before submitting it?

CMC Consulting September 30, 2020

name contains UTF-8 characters and like "test-äöü" and after upload on jira it looks like "test-???"

Tried but no luck. using spring boot 1.5 version. RestTemplate to make post.

for test reason updated boot to 2.0 and problem was fixed but unfortunately solution can't be version update.
there is also stackoverflow where i wrote details:
https://stackoverflow.com/questions/64086062/how-to-upload-file-with-utf-8-symbols-in-name-on-jira-task-as-attachment-using-s

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2020

So, when you tried pre-converting all the UTF-8 chars into ASCII before using that in the Post request, did it also fail?

The other possibility I can think of is that you're not defining the charset type properly in the Post request header. If you have a "-Encoding ASCII" or similar defined in the header, but are supplying UTF-8 encoded strings in the request, then that would explain why the request is being mis-interpreted.

Suggest an answer

Log in or Sign up to answer