On 1/08/2014 8:12 pm, Patrik Flykt wrote:

        Hi,

On Fri, 2014-08-01 at 12:53 +0300, Jukka Rissanen wrote:
Hi Lorn,

+       result = g_convert_with_fallback((const char *)ssid, -1,
+                                       "UTF-8", "ISO-8859-1",
+                                       0, 0,
+                                       &bytes_written, &error);

SSID's are just byte arrays, how can we know which codeset we are
converting from (you assume ISO-8859-1 here)?

hmm true. They can also contain mixed codeset characters.


We do not know the charset used for the SSID, so we can't do it like
this. The code below this patch goes through the SSID character by
character until it encounters a non-UTF-8 one. The offending characters
are replaced by the U+FFFD replacement character and thus the procedure
stitches up the name to be UTF-8 compliant.

That code results in an ssid configured on the AP as LT-test-Å
which from wpa_supplicant is this: LT-test-\xc5
to have <?> at the end.

g_utf8_validate seems to be failing in this instance, which makes the string to have that undecipherable <?> at the end. With mixed codeset characters, this completely fails (but mixed fails on every desktop platform I checked too)


_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to