Issue with CloudFront-Viewer-City Header

0

Encountering encoding discrepancies in the CloudFront-Viewer-City header. Despite percent decoding, the city name "Patiala" appears as "Pati%C4%81la". Seeking insights on rectifying this issue for accurate representation of city names.

Mohit
已提問 2 個月前檢視次數 106 次
1 個回答
1

From RFC 8187, we see non US-ASCII values require encoding.

By default, header field values in Hypertext Transfer Protocol (HTTP) messages cannot easily carry characters outside the US-ASCII coded character set. [...] This document specifies an encoding suitable for use in HTTP header fields that is compatible with a simplified profile of the encoding defined in RFC 2231.

Patiāla was UTF-8 character encoded, and then percent-encoded to be Pati%C4%81la

Here is a JavaScript example on how to decode that value:

console.log(decodeURIComponent('Pati%C4%81la'))
profile pictureAWS
已回答 2 個月前
profile picture
專家
已審閱 2 個月前
  • Just letting you know that "Patiala" name shouldn't have accented a character. You can confirm the name on Google Maps. In fact none of the places in India would need special characters.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南