From: Matt Ranostay Date: Wed, 29 May 2019 18:22:22 +0000 (-0700) Subject: binding: bluetooth-pbap: parse fn correctly for UTF-8 charset X-Git-Tag: 7.99.1^0 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F21456%2F1;p=apps%2Fagl-service-bluetooth-pbap.git binding: bluetooth-pbap: parse fn correctly for UTF-8 charset Don't include CHARSET=UTF-8 or the like in the JSON output. Bug-AGL: SPEC-2392 Change-Id: I85322e710b737bdfa58fe80ff5f0bbc0e298250b Signed-off-by: Matt Ranostay --- diff --git a/binding/bluetooth-vcard-parser.c b/binding/bluetooth-vcard-parser.c index 927443a..0b63209 100644 --- a/binding/bluetooth-vcard-parser.c +++ b/binding/bluetooth-vcard-parser.c @@ -51,12 +51,12 @@ static const gchar *VC_PREFIXES[VC_FIELD_COUNT] = { static void add_fn(json_object *resp, gchar *msg) { - gchar *name = msg + vc_len(VC_FORMATTED_NAME) + 1; + gchar *name = strstr(msg, ":"); - if (!name) - name = "UNKNOWN"; + if (!name || !strlen(name + 1)) + return; - json_object_object_add(resp, "fn", json_object_new_string(name)); + json_object_object_add(resp, "fn", json_object_new_string(++name)); } static void add_phone(json_object *array, gchar *msg)