google-apps-script utf8

2020-04-01 06:02发布

I use the following in a script:

var JSONResult = Maps.newGeocoder().geocode(member.address);
var AddressFormatted= JSONResult.results[0].formatted_address;

and the result is sometime look like

Rue de Cognel��e

I would like to force to have the result in UTF8 charset. How can I do that ?

Vincent

1条回答
The star\"
2楼-- · 2020-04-01 07:06

You can do charset conversions using Blobs. This example converts "foo" from UTF-8 to UTF-16.

Utilities.newBlob("").setDataFromString("foo", "UTF-8").getDataAsString("UTF-16")
查看更多
登录 后发表回答