IOSAD-93 consistently using precomposedStringWithCanonicalMapping, stringWithUTF8String
authorDirk Zimmermann <dirk@pep-project.org>
Thu, 17 May 2018 09:33:33 +0200
changeset 6169e50cc7cd612
parent 615 52097b5d3b72
child 617 060f20084fdb
IOSAD-93 consistently using precomposedStringWithCanonicalMapping, stringWithUTF8String
pEpObjCAdapter/PEPInternalSession.m
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Wed May 16 16:18:01 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Thu May 17 09:33:33 2018 +0200
     1.3 @@ -531,7 +531,8 @@
     1.4  
     1.5          PEP_STATUS status = trustword(_session,
     1.6                                        value,
     1.7 -                                      [languageID UTF8String],
     1.8 +                                      [[languageID precomposedStringWithCanonicalMapping]
     1.9 +                                       UTF8String],
    1.10                                        word.charPointerPointer,
    1.11                                        &size);
    1.12  
    1.13 @@ -653,7 +654,9 @@
    1.14  - (BOOL)importKey:(NSString * _Nonnull)keydata error:(NSError * _Nullable * _Nullable)error
    1.15  {
    1.16      [self lockWrite];
    1.17 -    PEP_STATUS status = import_key(_session, [keydata UTF8String], [keydata length], NULL);
    1.18 +    PEP_STATUS status = import_key(_session,
    1.19 +                                   [[keydata precomposedStringWithCanonicalMapping] UTF8String],
    1.20 +                                   [keydata length], NULL);
    1.21      [self unlockWrite];
    1.22  
    1.23      if ([NSError setError:error fromPEPStatus:status]) {
    1.24 @@ -724,8 +727,7 @@
    1.25      NSString *result = nil;
    1.26  
    1.27      if (![NSError setError:error fromPEPStatus:status]) {
    1.28 -        result = [NSString stringWithCString:trustwords.charPointer
    1.29 -                                    encoding:NSUTF8StringEncoding];
    1.30 +        result = [NSString stringWithUTF8String:trustwords.charPointer];
    1.31      }
    1.32  
    1.33      return result;