Google Cloud Load Balancer 自定义 headers 中的 unicode 值是如何编码的?

How are unicode values encoded in Google Cloud Load Balancer custom headers?

使用 Google Cloud Load Balancer 时,您可以将某些字段添加到自定义 header 中,例如 {client_city},它(当然?)是 unicode 字符串。

我无法在文档中找到这些在 header 中是如何编码的(记住 HTTP headers 只是 ASCII,或者根据 "obsolete" 可能是 Latin-1 HTTP RFC 中的作品)。

因为我所在的城市使用 ASCII 名称,所以我无法运行从我的本地盒子进行测试。

Google 有一个文档:

client_city:

Name of the city from which the request originated, for example, “Mountain View” for Mountain View, California. There is no canonical list of valid values for this variable. The city names may contain US-ASCII letters, numbers, spaces, and the following characters: !#$%&'*+-.^_`|~.

一些 headers 可以是 Unicode,而一些众所周知的 headers 是 Ascii。

https://cloud.google.com/load-balancing/docs/backend-service