无法为礼品卡奖品设置有效字符集 JSON 输出

Can't set valid charset for gift card prizes JSON output

我在使用 php 输出 JSON 时遇到一个奇怪的错误:

Invalid encoding, expecting UTF-8, UTF-16 or UTF-32.[Code 29, Structure 0]

我试过如下将其添加到 header,但到目前为止没有成功:

header('Content-type: application/json;charset=utf-8');

从此工具返回:https://jsonformatter.curiousconcept.com

JSON 提要位于此处:

https://www.pointsprizes.com/api/mobile/account/prizes/123132

尝试了所有我能想到的方法,尝试将其设置为 16 然后 32,但仍然没有成功。知道问题出在哪里吗?

艾米检查这个回复:

{"status":"success","reason":"","device":"","version":"","email":"john.smith@gmail.com","id":"123132","points":"1502","offers":"true","hyprmx":"true","prizes":"true","visit":"true","html":"<!doctype html><html lang='en'><head></head><body><p style='font-weight:900;'>received account_id: 123132</p><p>received device: </p><p>received version: </p></body></html>"}

HTMl也存在于此:

<!doctype html><html lang='en'><head></head><body><p style='font-weight:900;'>received account_id: 123132</p><p>received device: </p><p>received version: </p></body></html>

因为这个 html,json_decode() 显示:

<br />
<b>Parse error</b>:  syntax error, unexpected 'en' (T_STRING), expecting ',' or ')' in <b>[...][...]</b> on line <b>3</b><br />

当我删除它并 json_decode() 它时,它给出:

stdClass Object
(
    [status] => success
    [reason] => 
    [device] => 
    [version] => 
    [email] => john.smith@gmail.com
    [id] => 123132
    [points] => 1502
    [offers] => true
    [hyprmx] => true
    [prizes] => true
    [visit] => true
    [html] => 
)