message = "Ahoy World"
encoding, length_bits = sms_encoding_length(message)
print(f"Encoding: {encoding}")
print(f"Length in bits: {length_bits}")
Encoding: GSM-7
Length in bits: 70
message = "This is a test message with special characters: ñáéíóú"
encoding, length_bits = sms_encoding_length(message)
print(f"Encoding: {encoding}")
print(f"Length in bits: {length_bits}")
Encoding: UCS-2
Length in bits: 864
message = "Visit the Twilio booth at Hall A 03 during WeAreDeveloper World Congress"
encoding, length_bits = sms_encoding_length(message)
print(f"Encoding: {encoding}")
print(f"Length in bits: {length_bits}")
Encoding: GSM-7
Length in bits: 504
message = "Rumors say Twilio will provide healthy smoothies 🥤🍓🍍"
encoding, length_bits = sms_encoding_length(message)
print(f"Encoding: {encoding}")
print(f"Length in bits: {length_bits}")
Encoding: UCS-2
Length in bits: 880
My test results for the USC-2 length in bits are different with testset result provided here but same as message segment calculator