]>
Commit | Line | Data |
---|---|---|
10d52372 CM |
1 | --- bluez-4.78/src/event.c.orig 2010-11-08 11:58:02.359781937 +0200 |
2 | +++ bluez-4.78/src/event.c 2010-11-08 11:58:34.456448604 +0200 | |
3 | @@ -489,8 +489,16 @@ | |
4 | ||
0416a3b3 AM |
5 | /* It's ok to cast end between const and non-const since |
6 | * we know it points to inside of name which is non-const */ | |
7 | - if (!g_utf8_validate(name, -1, (const char **) &end)) | |
8 | - *end = '\0'; | |
9 | + if (!g_utf8_validate(name, -1, (const char **) &end)) { | |
10 | + char *utf8_name; | |
11 | + | |
12 | + utf8_name = g_convert(name, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL); | |
13 | + if (utf8_name) { | |
14 | + memcpy(name, utf8_name, 248); | |
15 | + g_free(utf8_name); | |
16 | + } else | |
17 | + *end = '\0'; | |
18 | + } | |
0416a3b3 | 19 | |
10d52372 CM |
20 | write_device_name(local, peer, name); |
21 | } |