NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: jari@softmade.fi on November 02, 2017, 05:30:34 AM

Title: webservice / Json output to utf-8
Post by: jari@softmade.fi on November 02, 2017, 05:30:34 AM
Hello

Where can I change webservice / Json to use utf-8?

Jari
Title: Re: webservice / Json output to utf-8
Post by: Bruce on November 03, 2017, 12:26:22 AM
Json output is always utf-8
So you shouldn't need to do anything... (although thinking about it, maybe there's things _I_ need to do....)

cheers
Bruce
Title: Re: webservice / Json output to utf-8
Post by: jari@softmade.fi on November 03, 2017, 02:25:24 AM
Now I get    "\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd" when I should get "äöäåää"

If you need some test help, I'll be happy to help

Jari
Title: Re: webservice / Json output to utf-8
Post by: Bruce on November 05, 2017, 09:44:51 PM
Hi Jari,

A small test program, with some finish data in it, would be handy - thanks.

cheers
Bruce

Title: Re: webservice / Json output to utf-8
Post by: jari@softmade.fi on November 06, 2017, 11:55:41 PM
Hi Bruce

Here you go :)

There is both code and data example and screenshot of Firefox

Jari
Title: Re: webservice / Json output to utf-8
Post by: jari@softmade.fi on December 11, 2017, 02:05:03 AM
Hi Bruce

Any news about this ?

Jari
Title: Re: webservice / Json output to utf-8
Post by: Bruce on December 12, 2017, 03:00:00 AM
Hi Jari,

thanks for the bump.

ok, so it's fixed in 10.13. Assuming the following;

1. the "Store Data As " setting is set correctly. (WebServer Procedure, advanced tab).
In the example you posted this was set to utf-8, but the TPS file contained "Scandinavian".
Until we get Unicode support in Clarion 11, I recommend that you "store as" your local code page, which in your case is Scandinavian - so correct that in your app.

2. The incoming JSON is _always_ UTF-8 (which is what it should be.)
Therefore if you are using a Clarion Client program, the JSON output from there MUST be converted to unicode (utf-8) before it is sent.

Cheers
Bruce

Title: Re: webservice / Json output to utf-8
Post by: jari@softmade.fi on December 13, 2017, 01:37:31 AM
Thanks Bruce

Looks like it's okay now  :)

Jari