4

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

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Vincent
  • 137
  • 3
  • 7

1 Answers1

6

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")
Corey G
  • 7,754
  • 1
  • 28
  • 28