Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I am trying to add assets through utf-8,but it seems like not working

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

2 answers

1 accepted

0 votes
Answer accepted
Hana Kučerová Community Leader Jan 18, 2021

Hi @Harshit Somani ,

would you please provide us information, how exactly does your request look like? Thank you.

Hana Kučerová Community Leader Jan 19, 2021

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.

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

@Hana Kučerová 

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 

Hana Kučerová Community Leader Jan 19, 2021

Hi @Harshit Somani ,

your response ends in spam, because of the provided URL. You would need to paste the code here. Thank you.

you can see my github repository here

 

Like Hana Kučerová likes this
Hana Kučerová Community Leader Jan 20, 2021

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"])
Hana Kučerová Community Leader Jan 20, 2021

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.

0 votes
Andy Heinzer Atlassian Team Jan 26, 2021

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

209 views 1 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you