Skip to content

Commit

Permalink
fix(string): initWithBytes instead of UTF8 string
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Nov 30, 2022
1 parent cc948ac commit b72dcf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion NativeScript/runtime/ArgConverter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b72dcf6

Please sign in to comment.