All Collections
API and Integration
Sending Unicode messages using HTTP API
Sending Unicode messages using HTTP API

How to encode messages with HTTP API to send Unicode characters

Amy avatar
Written by Amy
Updated over a week ago

When sending a message containing Unicode characters via HTTP API, it is necessary to Triple URL encode the message to avoid any encoding issues.

For example:

Triple encoding '你好' gives the following value: %2525E4%2525BD%2525A0%2525E5%2525A5%2525BD


Encoding can also be done via various programming languages:

ASP.NET (C#)

Using System.Web.HttpUtility;

HttpUtility.UrlEncode(HttpUtility.UrlEncode(HttpUtility.UrlEncode("string")));

Java

import java.net.URLEncoder;
URLEncoder.encode(URLEncoder.encode(URLEncoder.encode("string", "UTF-8"), "UTF-8"), "UTF-8");

PHP

urldecode(urldecode(urldecode($text)));


Note: When scheduling message with HTTP API, the scheduledatetime must be URL encoded once.

Did this answer your question?