# HG changeset patch # User Mark Doliner # Date 1138602159 0 # Node ID 4b7a8787432cf15b2d38887cd15a62ff2e7eb622 # Parent 27cd7d96a41af950b3381c9e1eacfb4cb9ae421d [gaim-migrate @ 15437] If the username in /etc/passwd is not utf8, don't write it to accounts.xml committer: Tailor Script diff -r 27cd7d96a41a -r 4b7a8787432c src/protocols/bonjour/bonjour.c --- a/src/protocols/bonjour/bonjour.c Mon Jan 30 06:05:52 2006 +0000 +++ b/src/protocols/bonjour/bonjour.c Mon Jan 30 06:22:39 2006 +0000 @@ -467,6 +467,15 @@ else fullname = _("Gaim User"); + /* Make sure fullname is valid UTF-8. If not, try to convert it. */ + if (!g_utf8_validate(fullname, -1, NULL)) + { + gchar *tmp; + tmp = g_locale_to_utf8(fullname, -1, NULL, NULL, NULL); + if ((tmp == NULL) || (*tmp == '\0')) + fullname = _("Gaim User"); + } + #else FARPROC myNetUserGetInfo = wgaim_find_and_loadproc("Netapi32.dll", "NetUserGetInfo");