google-apps-script utf8 [英] google-apps-script utf8
问题描述
var JSONResult = Maps.newGeocoder()。geocode(member.address) ;
var AddressFormatted = JSONResult.results [0] .formatted_address;
,其结果有时会看起来像
Rue deCognel e
我想强制以UTF8 charset结果。 您可以使用Blob进行字符集转换。这个例子将foo从UTF-8转换为UTF-16。 I use the following in a script: 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 You can do charset conversions using Blobs. This example converts "foo" from UTF-8 to UTF-16.
这篇关于google-apps-script utf8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
我该怎么做?
$ b $ pre $ Utilities.newBlob()。setDataFromString( foo,UTF-8)。getDataAsString(UTF-16)
var JSONResult = Maps.newGeocoder().geocode(member.address);
var AddressFormatted= JSONResult.results[0].formatted_address;
Utilities.newBlob("").setDataFromString("foo", "UTF-8").getDataAsString("UTF-16")