我创建了 SES 模板并从 aws-cli 呈现它,如您所见,非英语文本被替换为“?”,无论是纯文本版本还是 HTML 版本。如何解决这个问题?PS:我也通过发送电子邮件进行了检查。
以下是我的 TestMainTemplate.json 文件
{
"Template": {
"TemplateName": "TestTemplate01",
"SubjectPart": "????? {{name}}!",
"HtmlPart": "<h1>????? {{name}}??</h1><p>???????AWS?????{{favoriteservice}}????</p>",
"TextPart": "?? {{name}}??\r\n???????AWS?????{{favoriteservice}}????\r\n??"
}
}
Run Code Online (Sandbox Code Playgroud)
命令从 cli 将模板上传到 aws SES:
aws ses create-template --cli-input-json file://TestMainTemplate.json --region us-east-1
渲染模板的命令:
aws ses test-render-template --template-name TestTemplate01 --template-data '{ "name": "??" , "favoriteservice": "SES" }' --region us-east-1
输出:
Date: 2018-09-14T03:27:46.913Z
Message-ID: <5990...........ec2-user@ip-......ec2.internal>
Subject: ????? ??!
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_106793_202759574.1536895666913"
Content-Transfer-Encoding: quoted-printable
------=_Part_106793_202759574.1536895666913
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
?? ????
???????AWS?????SES????
??
------=_Part_106793_202759574.1536895666913 …Run Code Online (Sandbox Code Playgroud) 我使用 Retrofit 2.0.1 从服务器获取响应,有没有办法在不使用异步方法的情况下获取 HTTP 响应状态?
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://192.168.8.4/********/***/")
.addConverterFactory(GsonConverterFactory.create())
.build();
RequestInterface request = retrofit.create(RequestInterface.class);
HotelDetail hd;
Call<HotelDetail> call1 = request.getIndividualHotel("1");
hd = call1.execute().body();
Run Code Online (Sandbox Code Playgroud)