I am making an app which returns data through api and adds them as assets,but the names of assets being added should undergo utf encoding because I am not able to upload a name which contains special characters like ' â,€™ ',Can you please show a solution to the problem
Hi @Harshit Somani ,
would you please provide us information, how exactly does your request look like? Thank you.
Hi @Harshit Somani ,
I got notification, that you've mentioned me here, but I can't see any response here. Would you please try it again? Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai @Hana Kučerová https://docs.google.com/document/d/1GC9fSC61BtWhdoTLBZTHxUsNmPiY2wMmzT5OqvQuY80/edit?usp=sharing
I have given you a word document which consists of my python code,please have a look at it,you might get clear understanding of it.Thankyou
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have attached a word document which has my python code,please go throw it so that it would be clear for you.Thankyou
https://docs.google.com/document/d/1GC9fSC61BtWhdoTLBZTHxUsNmPiY2wMmzT5OqvQuY80/edit?usp=sharing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Harshit Somani ,
your response ends in spam, because of the provided URL. You would need to paste the code here. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Harshit Somani ,
thank you. I can confirm I'm able to reproduce the problem. When I send some "non standard" characters, I get error message:
Invalid UTF-8 start byte 0xfd
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 91] (through reference chain: com.atlassian.servicedesk.assets.asset.dto.ImmutableAssetDTO$Json["label"]->com.atlassian.servicedesk.assets.common.dto.ImmutableLabelDTO$Json["value"])
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It definitely seems like a bug to me. Probably it will be the best to contact official support. To be honest I can't think of any workaround, which would work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I understand that you are trying to use the Insights REST API in order to add content from another site, but are unable to in some cases due to some characters not being in UTF-8.
I came across another set of users that appears to have had a very similar problem over in https://community.atlassian.com/t5/Answers-Developer-Questions/Re-Re-ResponseStatusException-when-calling-REST-method/qaq-p/622711/comment-id/115788#M115788 in that post, Philip Stone mentioned the means by which he resolved this:
I enclosed the charset with a " in the header like this 'application/json;charset="UTF-8"' and it's working pretty well now.
Which you should be able to just adjust your header from
"Content-Type": "application/json"
into something more like
"Content-Type": "application/json; charset='UTF-8'"
to effect this change. This should insure that the payload being sent to the Atlassian site is using that character set.
Try this first. While I'm not well versed in using python, perhaps we can try to troubleshoot this further in order to better understand ways to get past this problem.
If that doesn't work, then take a look over at https://stackoverflow.com/questions/46408051/python-json-load-set-encoding-to-utf-8
The suggestion there is to instead decode the initial json payload to make sure that content is all in UTF-8 first. The method suggested there stores this a file first. I think this would be a better approach anyways, since it sounds like the source is not using UTF-8 encoding here.
If this does not work, please let me know what response you get back from this kind of call. Is there an error returned in the REST call response? Or is the request accepted, but appearing incorrect in some way?
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.