Sending iso-8859-1 chars from google apps script

前端 未结 1 326
天涯浪人
天涯浪人 2021-01-14 15:25

I\'m trying to invoke a service that sends a sms from a google apps script. The service wants the data in iso 8859-1. The code below send a message with the åäö as bad chars

相关标签:
1条回答
  • 2021-01-14 16:24

    As mentioned in the other question that Serge linked to in the comments, you can change the encoding of a string by first converting it to a Blob and then using the getDataAsString() method:

    var result = Utilities.newBlob('Hello World').getDataAsString('ISO-8859-1');
    
    0 讨论(0)
提交回复
热议问题