TwilioDevEd / message-segment-calculator

JS-based tool to calculate and display message segmentation data for a given message body
https://twiliodeved.github.io/message-segment-calculator/
MIT License
85 stars 35 forks source link

Calculator says encoding is UCS-2, but it looks like UTF-16? #5

Closed ctstacey closed 3 years ago

ctstacey commented 3 years ago

Great work! This is the best SMS segment calculator I have found on the web!

A small point: When I tried a few emojis like 😋 (U+1F60B) I found they seemed to encode correctly, but it looks like UTF-16. My understanding was the UCS-2 is fixed 16-bit width, so can't encode emojis. https://stackoverflow.com/questions/54771549/emojis-not-correctly-encode-into-hexadecimal#answer-54771717 http://www.differencebetween.net/technology/software-technology/difference-between-ucs-2-and-utf-16/

The calculator says it's using UCS-2, but is it actually using UTF-16?

(happy to submit pull requests, just asking for clarification before taking any actions)

ctstacey commented 3 years ago

If the coding is actually UTF-16 (for code points outside the BMP), do you want the UCS-2 description changed to UFT-16? If so, I'll submit a pull request (when time allows).

vernig commented 3 years ago

Agree with @ValZapod. The only two encodings allowed by GSM specs are GSM7 and UCS-2. AFAIK Emoji are built on top of the latter through surrogates.

From the point of view of the calculator, we decided to show only GSM7 and UCS2 because the main purpose of it is to calculate how many segments are going to be sent and which encoding will be used by the carrier.

vernig commented 3 years ago

I'm going to close this issue unless there are other inputs. Thanks all for contributing to the conversation!

ctstacey commented 3 years ago

All good, again, great work on the calculator!