API reference Development guidelines Quickstart Guides - Sending messages
- Character counting in a text
- Getting user IDs
- Stickers
- LINE emoji
- Use audiences
- Use quick replies
- Get statistics per aggregation unit
- Use LINE features with the LINE URL scheme
- Using beacons
- Sharing your LINE Official Account with users
- Linking user accounts
- Customize icon and display name
- 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 - Sending messages
- Character counting in a text
- Getting user IDs
- Stickers
- LINE emoji
- Use audiences
- Use quick replies
- Get statistics per aggregation unit
- Use LINE features with the LINE URL scheme
- Using beacons
- Sharing your LINE Official Account with users
- Linking user accounts
- Customize icon and display name
- 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 |
|