I want to send sms iwth Unicode characters via SMPP (JSMPP library). I know that for data encoding there should be 8, and sms length should be 70 characters. But when I try this, I get SMS with Chinese characters. Here is my code:
ESMClass esmClass = new ESMClass();
GeneralDataCoding coding = new GeneralDataCoding(8)
String text = "üöğçşə ƏIÖĞŞÇÜ";
String p = HexUtil.convertStringToHexString(text);
byte[] textByte = HexUtil.convertHexStringToBytes(p);
String messageId = session.submitShortMessage("CMT",TypeOfNumber.INTERNATIONAL,
NumberingPlanIndicator.UNKNOWN,"1111", TypeOfNumber.INTERNATIONAL,
NumberingPlanIndicator.UNKNOWN, "phone_number", esmClass,
(byte) 0, (byte) 1, timeFormatter.format(new Date()), null,
new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT),
(byte) 0, coding, (byte) 0, textByte);
After that, I get a message with Chinese characters. What's wrong?
source
share