Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use UTF-8 charset in Google Apps Script

I use the following in a script:

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

and the result sometimes look like

Rue de Cognel��e

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

Vincent

like image 503
Vincent Avatar asked Sep 19 '25 10:09

Vincent


1 Answers

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")
like image 183
Corey G Avatar answered Sep 21 '25 00:09

Corey G