• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Character set / encoding of results of REST web call

Status
Not open for further replies.

Rune Jacobsen

Forum User
Joined
Aug 23, 2018
Messages
7
Reaction score
4
Hi there,

I am working on a project for a client, and one of the steps of the call flow I am building is to call a REST based web service. The call works (the web server is called and returns a response) but I get an exception from 3CX because the encoding of the result is in UTF-8 format. The exception message in the 3CXQueueManager file is:

System.ArgumentException: '"UTF-8"' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

I can of course include the full exception details if necessary.

This brings me two questions:

1. Is there a way to get 3CX to accept UTF-8? This is not an uncommon encoding used on the web, so this would be my preferred fix if possible.

2. If we can't use UTF-8, what encoding(s) would be acceptable to 3CX? Is there a list or documentation that specifies this? I have not been able to find anything, but my google-fu might be failing me.

Thanks for any input!
 
Hello @Rune Jacobsen,

I have seen this error being reported by the .NET HTTP implementation. The problem is not UTF-8 not being supported. The problem here is that the server is returning the value with quotes, while it shouldn't.

The HTTP response received from the server has the following header:
Content-Type: application/json; charset="utf-8"

But the correct value should be without quotes:
Content-Type: application/json; charset=utf-8

If you have access to the server, you need to change that when you generate the response. Otherwise, you need to contact the server app developer to make this change for you.

Kind regards.
 
Hi Ernesto,

Thank you very much for your quick response!

I have passed this information on to the developer of the web app that we're calling. We'll see if this is something they can fix easily, or if we'll have to handle it another way.

Thanks again!

Best regards,

Rune Jacobsen
 
Hi @edossantos,

I just wanted to confirm that after the developer of the web service being used removed the quotes around the character set everything worked fine. Thanks again for your help!

Best regards,

Rune Jacobsen
 
  • Like
Reactions: edossantos and jed
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Members Online Now

Forum statistics

Threads
141,625
Messages
748,873
Members
144,738
Latest member
MattS
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.