Forum Discussion

iGanja's avatar
iGanja
New Contributor
7 years ago

JSON results from my REST service are all Chinese (looking) characters

I have a REST WebAPI service that returns json, but when viewing the results in SoapUI, all the characters look Chinese.

 

笀∀䄀挀挀漀甀渀琀匀栀愀爀攀猀∀㨀嬀笀∀䤀搀∀㨀∀  ∀Ⰰ∀匀栀愀爀攀䌀漀搀攀∀㨀 Ⰰ∀吀礀瀀攀∀㨀 Ⰰ∀䐀攀猀挀爀椀瀀琀椀漀渀∀㨀∀匀䄀嘀䤀一䜀匀 䄀䌀䌀伀唀一吀∀Ⰰ∀伀瀀攀渀䐀愀琀攀∀㨀∀㈀ ㄀㜀ⴀ 㠀ⴀ㄀㄀吀  㨀  㨀  ∀Ⰰ∀䌀氀漀猀攀䐀愀琀攀∀㨀∀   ㄀ⴀ ㄀ⴀ ㄀吀  㨀  㨀  ∀Ⰰ∀䄀瘀愀椀氀愀戀氀攀䈀愀氀愀渀挀攀∀㨀 ⸀  Ⰰ∀䈀愀氀愀渀挀攀∀㨀㔀⸀  Ⰰ∀䐀椀瘀夀琀搀∀㨀 ⸀  Ⰰ∀䐀椀瘀䰀愀猀琀夀攀愀爀∀㨀 ⸀  紀崀Ⰰ∀䄀挀挀漀甀渀琀䰀漀愀渀猀∀㨀嬀笀∀䤀搀∀㨀∀ ㄀∀Ⰰ∀吀礀瀀攀∀㨀㄀㐀Ⰰ∀䐀攀猀挀爀椀瀀琀椀漀渀∀㨀∀㈀ ㄀㘀 䴀䔀刀䌀䔀䐀䔀匀ⴀ䈀䔀一娀 䜀䰀䔀 䌀䰀䄀匀匀 唀∀Ⰰ∀伀瀀攀渀䐀愀琀攀∀㨀∀㈀ ㄀㜀ⴀ 㠀ⴀ㄀㄀吀  㨀  㨀  ∀Ⰰ∀䈀愀氀愀渀挀攀∀㨀㈀㄀㈀㠀㘀⸀㈀㘀Ⰰ∀倀愀礀洀攀渀琀䐀甀攀∀㨀㔀㔀㤀⸀㄀㔀Ⰰ∀䐀甀攀䐀愀琀攀∀㨀∀㈀ ㄀㠀ⴀ ㈀ⴀ㄀㜀吀  㨀  㨀  ∀Ⰰ∀䤀渀琀攀爀攀猀琀夀琀搀∀㨀㘀㔀⸀㠀㐀紀崀Ⰰ∀䄀挀挀漀甀渀琀䤀刀䄀猀∀㨀嬀崀Ⰰ∀一甀洀戀攀爀∀㨀∀    㘀㤀 㘀㐀㌀∀Ⰰ∀匀匀一∀㨀渀甀氀氀Ⰰ∀䘀椀爀猀琀一愀洀攀∀㨀渀甀氀氀Ⰰ∀䰀愀猀琀一愀洀攀∀㨀渀甀氀氀Ⰰ∀䈀椀爀琀栀䐀愀琀攀∀㨀渀甀氀氀Ⰰ∀倀栀漀渀攀∀㨀渀甀氀氀Ⰰ∀䰀漀猀猀䴀椀琀∀㨀昀愀氀猀攀紀

 

In all other REST clients I have used, the result is correctly displayed as English characters.

{
"AccountShares": [
{
"Id": "00",
"ShareCode": 0,
"Type": 0,
"Description": "SAVINGS ACCOUNT",
"OpenDate": "2017-08-11T00:00:00",
"CloseDate": "0001-01-01T00:00:00",
"AvailableBalance": 0,
"Balance": 5,
"DivYtd": 0,
"DivLastYear": 0
}
],
"AccountLoans": [
{
"Id": "01",
"Type": 14,
"Description": "2016 MERCEDES-BENZ GLE CLASS U",
"OpenDate": "2017-08-11T00:00:00",
"Balance": 21286.26,
"PaymentDue": 559.15,
"DueDate": "2018-02-17T00:00:00",
"InterestYtd": 65.84
}
],
"AccountIRAs": [],
"Number": "0000xxxxxx",
"SSN": null,
"FirstName": null,
"LastName": null,
"BirthDate": null,
"Phone": null,
"LossMit": false
}

 

What gives?

  • Apparently Content-Type application/json; charset=utf-16 is interpreted differently in SoapUI. (maybe correctly faik)

    Switching to Content-Type application/json; charset=utf-8 solved the problem.

  • iGanja's avatar
    iGanja
    New Contributor

    Apparently Content-Type application/json; charset=utf-16 is interpreted differently in SoapUI. (maybe correctly faik)

    Switching to Content-Type application/json; charset=utf-8 solved the problem.