I wrote a simple Android application to decode the SSID and display it, unfortunately I am having a slight issue. Some control characters are handled incorrectly by the ScanResult class.
It looks like the UTF-8 decoder in String is replacing these invalid byte sequences.
Update: the octets can be obtained from the object's "wifiSsid.octets" buffer:
/** * Ascii encoded SSID. This will replace SSID when we deprecate it. @hide */ public WifiSsid wifiSsid;
We cannot just straight out use Java reflection as we get a classNotFoundException when trying to use the internal API during development as explained here.