From 21445b50fac323ee9fab8970eda597f1c258ff21 Mon Sep 17 00:00:00 2001 From: Dawid Date: Mon, 5 Aug 2024 11:16:34 +0200 Subject: [PATCH 1/2] fix handling utf-8 keys --- .../Common/cpp/worklets/SharedItems/Shareables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp b/packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp index edde6ff9aafc..63717c9e479e 100644 --- a/packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp +++ b/packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp @@ -233,7 +233,7 @@ ShareableObject::ShareableObject( jsi::Value ShareableObject::toJSValue(jsi::Runtime &rt) { auto obj = jsi::Object(rt); for (size_t i = 0, size = data_.size(); i < size; i++) { - obj.setProperty(rt, data_[i].first.c_str(), data_[i].second->toJSValue(rt)); + obj.setProperty(rt, jsi::String::createFromUtf8(rt, data_[i].first), data_[i].second->toJSValue(rt)); } #if SUPPORTS_NATIVE_STATE if (nativeState_ != nullptr) { From 661244ea493c966e2b6499b5dbb954c51fefee88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Mon, 5 Aug 2024 12:07:27 +0200 Subject: [PATCH 2/2] Update packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp Co-authored-by: Tomek Zawadzki --- .../Common/cpp/worklets/SharedItems/Shareables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp b/packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp index 63717c9e479e..357e00548c74 100644 --- a/packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp +++ b/packages/react-native-reanimated/Common/cpp/worklets/SharedItems/Shareables.cpp @@ -233,7 +233,7 @@ ShareableObject::ShareableObject( jsi::Value ShareableObject::toJSValue(jsi::Runtime &rt) { auto obj = jsi::Object(rt); for (size_t i = 0, size = data_.size(); i < size; i++) { - obj.setProperty(rt, jsi::String::createFromUtf8(rt, data_[i].first), data_[i].second->toJSValue(rt)); + obj.setProperty(rt, jsi::String::createFromUtf8(rt, data_[i].first), data_[i].second->toJSValue(rt)); } #if SUPPORTS_NATIVE_STATE if (nativeState_ != nullptr) {