Skip to content

Issue with encoding of Unicode characters #1903

@scottbarstow

Description

@scottbarstow

When sending Japanese characters in SMS body, the message that goes out to the provider is not being encoded correctly.

If you set the SMS body to either:

Original: 日本語
Encoded (UTF-8): %e6%97%a5%e6%9c%ac%e8%aa%9e

It shows up at the destination as '???'

Here's the curl command to send the message:

curl -X POST http://sid:pwd@ip/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948ages -d "To=number" -d "From=number" -d "Body=%e6%97%a5%e6%9c%ac%e8%aa%9e"

Here is the resulting payload from the SMS API:

<RestcommResponse>
  <SMSMessage>
    <Sid>sid</Sid>
    <DateCreated>Fri, 3 Mar 2017 01:29:16 +0000</DateCreated>
    <DateUpdated>Fri, 3 Mar 2017 01:29:16 +0000</DateUpdated>
    <DateSent/>
    <AccountSid>sid</AccountSid>
    <From>number</From>
    <To>number</To>
    <Body>日本語</Body>
    <Status>sending</Status>
    <Direction>outbound-api</Direction>
    <Price>0</Price>
    <PriceUnit>USD</PriceUnit>
    <ApiVersion>2012-04-24</ApiVersion>
    <Uri>/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/SMS/Messages/SM85c966c2ede04fd481af30677c621440</Uri>
  </SMSMessage>

Last, here is how it shows up on the handset.

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions