From 4e932d85dd9a9637586584c034a0ac8532425191 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Wed, 19 Nov 2014 14:26:20 +0100 Subject: [PATCH] Fix a crash in FastAddressBook with non-breaking utf8 spaces. Possibly needs a rework down in belle-sip --- Classes/Utils/FastAddressBook.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 042c0afa2..0fe380de8 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -72,6 +72,8 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf } + (NSString*)normalizeSipURI:(NSString*)address { + // replace all whitespaces (non-breakable, utf8 nbsp etc.) by the "classical" whitespace + address = [[address componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] componentsJoinedByString:@" "]; NSString *normalizedSipAddress = nil; LinphoneAddress* linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], [address UTF8String]); if(linphoneAddress != NULL) {