diff --git a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp index 34d1e49d29..710ce35c0d 100644 --- a/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp +++ b/weex_core/Source/core/bridge/platform/core_side_in_platform.cpp @@ -388,10 +388,9 @@ int CoreSideInPlatform::RefreshInstance( }} } }; - - auto final_json_str = final_json.dump().c_str(); - auto utf16_key = weex::base::to_utf16(const_cast(final_json_str), - strlen(final_json_str)); + std::string out = final_json.dump(); + auto utf16_key = weex::base::to_utf16(const_cast(out.c_str()), + out.length()); args->value.string = genWeexString( reinterpret_cast(utf16_key.c_str()), utf16_key.size()); msg.push_back(args);