Hi,
When UCS-2 encoded SMS are received, the text variable is empty, and replaced by ucs-2 in the json payload.
Here is a sample message extracted with the uqmi -s -d $device --get-message $messageID --storage $storage command (sensitive data redacted):
{"smsc":"+336xxxxxxxx","sender":"Free Mobile","timestamp":"2024-02-20 20:58:04","concat_ref":67,"concat_part":4,"concat_parts":4,"ucs-2":"00200070006100730073006500200064006500200076006f0074007200650020004500730070006100630065002000410062006f006e006e00e900200065007400200063006f006e00740061006300740065007a002d006e006f0075007300200061007500200033003200340034002e"}
As a custom fix, I've added the following lines between fi and echo "$sender" > $receiveFolder/$sms_file in /usr/bin/uqmi_d.sh:
if [ ! -n "$text" ]
then
json_get_var ucs_2 ucs-2
text=$(echo $ucs_2 | sed -r 's/00([0-9a-f][0-9a-f])/\1/g' | xxd -r -p)
fi
It's a quick and ugly fix as it depends on xxd, which is not part of your dependencies, and the charset conversion is not done in a proper way.
Kind regards,
Hi,
When UCS-2 encoded SMS are received, the
textvariable is empty, and replaced byucs-2in the json payload.Here is a sample message extracted with the
uqmi -s -d $device --get-message $messageID --storage $storagecommand (sensitive data redacted):{"smsc":"+336xxxxxxxx","sender":"Free Mobile","timestamp":"2024-02-20 20:58:04","concat_ref":67,"concat_part":4,"concat_parts":4,"ucs-2":"00200070006100730073006500200064006500200076006f0074007200650020004500730070006100630065002000410062006f006e006e00e900200065007400200063006f006e00740061006300740065007a002d006e006f0075007300200061007500200033003200340034002e"}As a custom fix, I've added the following lines between
fiandecho "$sender" > $receiveFolder/$sms_filein/usr/bin/uqmi_d.sh:It's a quick and ugly fix as it depends on
xxd, which is not part of your dependencies, and the charset conversion is not done in a proper way.Kind regards,