I’m trying to read an utf-16 text from a GSM module(Sim800 L). It gives me :
0633064406270645 06280647 0647064506af06cc
Rather than :
u0633u0644u0627u0645 u0628u0647 u0647u0645u06afu06cc
I tried many ways to add ‘u’ to first string or even convert it to bytes , but every time python recognizes them real ascii characters.
For example:
> Str=r’u’ + Str
Result: \u633064406270645 06280647 0647064506af06cc
And because of double backslash python doesn’t recognize it as utf-16
I am looking for any method to convert the output of GSM module to unicode.
New contributor
Kaveh Kavianpour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.