小编Fus*_*ube的帖子

Delphi 7 - Charset REST JSON

使用Delphi 7和Indy 9.00.10我正在使用带有JSON的REST API.我像这样用TidHTTP组件创建一个GET请求.

IdHTTP1.HandleRedirects := True;
IdHTTP1.ReadTimeout     := 5000;
IdHTTP1.Request.Accept  := 'application/json';
IdHTTP1.Request.AcceptCharSet  := 'UTF-8';
IdHTTP1.Request.AcceptLanguage := 'sv';
IdHTTP1.Request.ContentType    := 'application/json';
Memo1.Text := IdHTTP1.Get('http://api.arbetsformedlingen.se/af/v0/platsannonser/7088149');
Run Code Online (Sandbox Code Playgroud)

我尝试了几个字符集,但无法在响应中更正å,ä,ö等瑞典字符.

  • å变成Ã¥
  • ä成为Ã
  • ö成为Ã

我在这做错了什么?

delphi rest json indy character-encoding

2
推荐指数
1
解决办法
1110
查看次数

标签 统计

character-encoding ×1

delphi ×1

indy ×1

json ×1

rest ×1