From b72dcf626333a1dcdf21d092b5422b78953a7817 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Wed, 12 Oct 2022 11:40:26 -0700 Subject: [PATCH] fix(string): initWithBytes instead of UTF8 string --- NativeScript/runtime/ArgConverter.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NativeScript/runtime/ArgConverter.mm b/NativeScript/runtime/ArgConverter.mm index d22ad4d5..2d5cbd7b 100644 --- a/NativeScript/runtime/ArgConverter.mm +++ b/NativeScript/runtime/ArgConverter.mm @@ -249,7 +249,7 @@ if (type == BinaryTypeEncodingType::IdEncoding || type == BinaryTypeEncodingType::InterfaceDeclarationReference) { std::string strValue = tns::ToString(isolate, value); - id data = [NSString stringWithUTF8String:strValue.c_str()]; + id data = [[NSString alloc] initWithBytes:strValue.c_str() length:strValue.length() encoding:NSUTF8StringEncoding]; *(CFTypeRef*)retValue = CFBridgingRetain(data); return; }