Attention is currently required from: fixeria, laforge.
biocape has posted comments on this change by biocape. ( https://gerrit.osmocom.org/c/pysim/+/41913?usp=email )
Change subject: Decode GSM 7-bit packed EF.PNN data ......................................................................
Patch Set 1:
(1 comment)
File pySim/ts_51_011.py:
https://gerrit.osmocom.org/c/pysim/+/41913/comment/c8daa132_9cfe8b43?usp=ema... : PS1, Line 906: return data.decode('utf_16_be')
I'd assume this is all possible without too much imperative code and with some construct-magic. […]
Done — moved to pyosmocom as NetworkNameAdapter in I4661352e39031dc0041fc7851f675d6083a1035f.
I don't think parameterizing GsmOrUcs2Adapter works here: the Network Name header collides with the Annex A magic bytes. E.g. a 10-septet GSM 7-bit name starts with 0x82, which Annex A would read as UCS-2 variant 3. So I gave it its own adapter.
Also fixed two bugs from patchset 1 along the way: coding scheme is bits 7-5 (not bit 7), and the UCS-2 encode header should be 0x90, not 0xC0 (reserved).