JSON 数据中的奇数字符,替换为 "takeout character"?
Odd characters in JSON data, replaced with a "takeout character"?
我正在使用 TVHeadend 作为电视到网络服务器。它有一个 JSON API 用于频道列表和电子节目指南 (EPG) 等内容。我的问题是 EPG 数据有时包含重音字符,这会导致 iOS 客户端窒息。
为了调试,我在 macOS 上使用 Postman 检查从服务器获取的数据。这是在 Postman 中查看的具有 "bad" 数据的 EPG 条目之一的示例:
{
"eventId": 14277,
"episodeId": 14278,
"channelName": "49.3 CometTV",
"channelUuid": "02fe96403d58d53d71fde60649bf2b9a",
"channelNumber": "49.3",
"start": 1480266000,
"stop": 1480273200,
"title": "The Brain That Wouldn't Die",
"description": "Dr. Bill Cortner and his fianc�e, Jan Compton , are driving to his lab when they get into a horrible car accident. Compton is decapitated. But Cortner is not fazed by this seemingly insurmountable hurdle. His expertise is in transplants, and he is excited to perform the first head transplant. Keeping Compton's head alive in his lab, Cortner plans the groundbreaking yet unorthodox surgery. First, however, he needs a body."
},
如您所见,Postman 在外卖中有 "translated" 个重音字符。这很好,所以有人知道他们用来做这件事的逻辑吗?
问题很可能出在 TVHeadend 配置中,并且与频道是否符合所需的字符集有关。我认为您无法在接收端修复它。
您可能想查看此线程以获取更多信息:
我正在使用 TVHeadend 作为电视到网络服务器。它有一个 JSON API 用于频道列表和电子节目指南 (EPG) 等内容。我的问题是 EPG 数据有时包含重音字符,这会导致 iOS 客户端窒息。
为了调试,我在 macOS 上使用 Postman 检查从服务器获取的数据。这是在 Postman 中查看的具有 "bad" 数据的 EPG 条目之一的示例:
{
"eventId": 14277,
"episodeId": 14278,
"channelName": "49.3 CometTV",
"channelUuid": "02fe96403d58d53d71fde60649bf2b9a",
"channelNumber": "49.3",
"start": 1480266000,
"stop": 1480273200,
"title": "The Brain That Wouldn't Die",
"description": "Dr. Bill Cortner and his fianc�e, Jan Compton , are driving to his lab when they get into a horrible car accident. Compton is decapitated. But Cortner is not fazed by this seemingly insurmountable hurdle. His expertise is in transplants, and he is excited to perform the first head transplant. Keeping Compton's head alive in his lab, Cortner plans the groundbreaking yet unorthodox surgery. First, however, he needs a body."
},
如您所见,Postman 在外卖中有 "translated" 个重音字符。这很好,所以有人知道他们用来做这件事的逻辑吗?
问题很可能出在 TVHeadend 配置中,并且与频道是否符合所需的字符集有关。我认为您无法在接收端修复它。
您可能想查看此线程以获取更多信息: