Use the chardet module to try to detect what encoding the SSID uses. Add a column to the wireless network ListStore in the network spoke to store the original byte sequence (also encoded as a string because GLib is awful at storing byte sequences).
Updated to use GBytes, dumped the chardet module in favor of a libnm-util function that does the same thing, and changed nm._settings_for_ap to leave the SSID as bytes when looking up a connection by ssid.
Tested with ASCII and UTF-8 SSIDs. It's not able to connect to a latin-1 SSID but it looks like that's a NM bug: NetworkManager is crashing and it appears to be because nm_utils_ssid_to_utf8 is returning NULL on the other end of the dbus call.
Actually, what I could have done is just set the column type to PyObject and not worry about boxing and unboxing at all. So maybe one more try at this, tomorrow.
Definitely, that makes a lot of sense. Using `GBytes` is useful when you have large buffers (e.g. wrapping `GMappedFile`) that is mostly passed between C -> binding -> C, then you don't pay for lots of memcpy. But that doesn't apply here.
anaconda-patches@lists.fedorahosted.org