NetTalk Central

Author Topic: webservice / Json output to utf-8  (Read 5955 times)

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
webservice / Json output to utf-8
« on: November 02, 2017, 05:30:34 AM »
Hello

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

Jari

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: webservice / Json output to utf-8
« Reply #1 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

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: webservice / Json output to utf-8
« Reply #2 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: webservice / Json output to utf-8
« Reply #3 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


jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: webservice / Json output to utf-8
« Reply #4 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

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: webservice / Json output to utf-8
« Reply #5 on: December 11, 2017, 02:05:03 AM »
Hi Bruce

Any news about this ?

Jari

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: webservice / Json output to utf-8
« Reply #6 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


jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: webservice / Json output to utf-8
« Reply #7 on: December 13, 2017, 01:37:31 AM »
Thanks Bruce

Looks like it's okay now  :)

Jari