API reference Development guidelines Quickstart Guides - Send messages
- Character counting in a text
- Get user IDs
- Stickers
- LINE emoji
- Use audiences
- Use quick replies
- Get statistics of sent messages
- Use LINE features with the LINE URL scheme
- Use beacons with LINE
- Gain friends of your LINE Official Account
- User account linking
- Customize icon and display name
- Display a loading animation
- Use membership features
- Get quote tokens
- Retrying a failed API request
- Stop using your LINE Official Account
- Stop using the Messaging API
- Tutorial - Make a reply bot
Webhooks Rich menus LINE Bot Designer Flex Message Concepts Reference Resources
API reference Development guidelines Quickstart Guides - Send messages
- Character counting in a text
- Get user IDs
- Stickers
- LINE emoji
- Use audiences
- Use quick replies
- Get statistics of sent messages
- Use LINE features with the LINE URL scheme
- Use beacons with LINE
- Gain friends of your LINE Official Account
- User account linking
- Customize icon and display name
- Display a loading animation
- Use membership features
- Get quote tokens
- Retrying a failed API request
- Stop using your LINE Official Account
- Stop using the Messaging API
- Tutorial - Make a reply bot
Webhooks Rich menus LINE Bot Designer Flex Message Concepts Reference Resources
# Character counting in a text
The Messaging API counts text characters in UTF-16 code units (16-bit). Characters made up of multiple code units (e.g. some Kanji characters, Unicode emojis) are counted as more than one character. For example, a Unicode emoji 🍎 is expressed in two code units. Thus 🍎 is two characters long, not one.
When the Messaging API counts a text that has a LINE emoji, the emoji placeholder ($
) is replaced with the emoji's alternative text. Alternative text is the text displayed instead of the emoji on devices that can't display LINE emojis. Therefore, when sending a text message that has a LINE emoji, the text length may unintentionally exceed the maximum length and sending the message may fail. Note that LINE doesn't disclose the alternative text for LINE emojis.
However, the properties listed below are counted in grapheme cluster (opens new window) units, not in UTF-16 code units:
Type | Property |
---|---|
All action objects |
|
Postback action objects |
|
Message action objects |
|
Buttons template messages |
|
Confirm template messages |
|
Carousel template messages |
|
Rich menu objects |
|