Wi-Fi SSIDs are byte arrays, they are not strings. Thus, an SSID may
contain embedded NULLs and other unprintable characters. Often it is
useful to print the SSID out for debugging purposes, but that should be the
only use of this function. Do not use this function for any persistent
storage of the SSID, since the printable SSID returned from this function
cannot be converted back into the real SSID of the access point.
This function does almost everything humanly possible to convert the input
into a printable UTF-8 string, using roughly the following procedure:
if the input data is already UTF-8 safe, no conversion is performed
attempts to get the current system language from the LANG environment
variable, and depending on the language, uses a table of alternative
encodings to try. For example, if LANG=hu_HU, the table may first try
the ISO-8859-2 encoding, and if that fails, try the Windows-1250 encoding.
If all fallback encodings fail, replaces non-UTF-8 characters with '?'.
If the system language was unable to be determined, falls back to the
ISO-8859-1 encoding, then to the Windows-1251 encoding.
If step 3 fails, replaces non-UTF-8 characters with '?'.
Again, this function should be used for debugging and display purposes
only.
Parameters
ssid: string|Uint8Array<ArrayBufferLike>
pointer to a buffer containing the SSID data
Returns string
an allocated string containing a UTF-8 representation of the SSID, which must be freed by the caller using g_free(). Returns null on errors.
Wi-Fi SSIDs are byte arrays, they are not strings. Thus, an SSID may contain embedded NULLs and other unprintable characters. Often it is useful to print the SSID out for debugging purposes, but that should be the only use of this function. Do not use this function for any persistent storage of the SSID, since the printable SSID returned from this function cannot be converted back into the real SSID of the access point.
This function does almost everything humanly possible to convert the input into a printable UTF-8 string, using roughly the following procedure:
Again, this function should be used for debugging and display purposes only.