I have a code to determine Text parameter using pdutext.GSM7 or pdutext.UCS2 like here :
sm, err := smpp_transmitter.Submit(&smpp.ShortMessage{
Src: data_map[`sender_masking`],
Dst: data_map[`msisdn`],
Text: pdutext.GSM7(data_map[`sms`]),
Register: pdufield.NoDeliveryReceipt,
})
my goal is to detect if data_map[sms] contains non-GSM character, it will using pdutext.UCS2, otherwise will use pdutext.GSM7. i have mid solution by listing all character in condition. but i tought there will be efficient way to do that
I think you can use regex. May be like this: