Change encoding to UTF8.

pull/13498/head
Lukas Lipka 7 years ago
parent 6fc02c6a2b
commit ed0c562d67
  1. 2
      src/objective-c/GRPCClient/private/NSDictionary+GRPC.m
  2. 2
      src/objective-c/GRPCClient/private/NSError+GRPC.m

@ -54,7 +54,7 @@
+ (instancetype)grpc_stringFromMetadataValue:(grpc_metadata *)metadata { + (instancetype)grpc_stringFromMetadataValue:(grpc_metadata *)metadata {
return [[self alloc] initWithBytes:GRPC_SLICE_START_PTR(metadata->value) return [[self alloc] initWithBytes:GRPC_SLICE_START_PTR(metadata->value)
length:GRPC_SLICE_LENGTH(metadata->value) length:GRPC_SLICE_LENGTH(metadata->value)
encoding:NSASCIIStringEncoding]; encoding:NSUTF8StringEncoding];
} }
// Precondition: This object contains only ASCII characters. // Precondition: This object contains only ASCII characters.

@ -27,7 +27,7 @@ NSString * const kGRPCErrorDomain = @"io.grpc";
if (statusCode == GRPC_STATUS_OK) { if (statusCode == GRPC_STATUS_OK) {
return nil; return nil;
} }
NSString *message = [NSString stringWithCString:details encoding:NSASCIIStringEncoding]; NSString *message = [NSString stringWithCString:details encoding:NSUTF8StringEncoding];
return [NSError errorWithDomain:kGRPCErrorDomain return [NSError errorWithDomain:kGRPCErrorDomain
code:statusCode code:statusCode
userInfo:@{NSLocalizedDescriptionKey: message}]; userInfo:@{NSLocalizedDescriptionKey: message}];

Loading…
Cancel
Save