FreeCalypso > hg > freecalypso-tools
comparison uptools/libcoding/decode_helpers.c @ 802:1c599681fd60
pcm-sms-decode & sms-pdu-decode: revamp bad char decoding
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Thu, 25 Mar 2021 02:58:30 +0000 |
| parents | 978571e23318 |
| children |
comparison
equal
deleted
inserted
replaced
| 801:da724c67159d | 802:1c599681fd60 |
|---|---|
| 46 if (uni < 0x800) { | 46 if (uni < 0x800) { |
| 47 outp[0] = 0xC0 | (uni >> 6); | 47 outp[0] = 0xC0 | (uni >> 6); |
| 48 outp[1] = 0x80 | (uni & 0x3F); | 48 outp[1] = 0x80 | (uni & 0x3F); |
| 49 return(2); | 49 return(2); |
| 50 } | 50 } |
| 51 outp[0] = 0xE0 | (uni >> 12); | 51 if (uni < 0x10000) { |
| 52 outp[1] = 0x80 | ((uni >> 6) & 0x3F); | 52 outp[0] = 0xE0 | (uni >> 12); |
| 53 outp[2] = 0x80 | (uni & 0x3F); | 53 outp[1] = 0x80 | ((uni >> 6) & 0x3F); |
| 54 return(3); | 54 outp[2] = 0x80 | (uni & 0x3F); |
| 55 return(3); | |
| 56 } | |
| 57 outp[0] = 0xF0 | (uni >> 18); | |
| 58 outp[1] = 0x80 | ((uni >> 12) & 0x3F); | |
| 59 outp[2] = 0x80 | ((uni >> 6) & 0x3F); | |
| 60 outp[3] = 0x80 | (uni & 0x3F); | |
| 61 return(4); | |
| 55 } | 62 } |
