diff --git a/unreal/Puerts/Source/JsEnv/Public/V8Utils.h b/unreal/Puerts/Source/JsEnv/Public/V8Utils.h index f8800edcea..6cf149d373 100644 --- a/unreal/Puerts/Source/JsEnv/Public/V8Utils.h +++ b/unreal/Puerts/Source/JsEnv/Public/V8Utils.h @@ -106,7 +106,11 @@ class FV8Utils FORCEINLINE static FString ToFString(v8::Isolate* Isolate, v8::Local Value) { +#if WITH_QUICKJS + return UTF8_TO_TCHAR(*(v8::String::Utf8Value(Isolate, Value))); +#else return UTF16_TO_TCHAR(*(v8::String::Value(Isolate, Value))); +#endif } FORCEINLINE static FName ToFName(v8::Isolate* Isolate, v8::Local Value) @@ -148,7 +152,11 @@ class FV8Utils FORCEINLINE static v8::Local ToV8String(v8::Isolate* Isolate, const TCHAR* String) { +#if WITH_QUICKJS + return v8::String::NewFromUtf8(Isolate, TCHAR_TO_UTF8(String), v8::NewStringType::kNormal).ToLocalChecked(); +#else return v8::String::NewFromTwoByte(Isolate, TCHAR_TO_UTF16(String), v8::NewStringType::kNormal).ToLocalChecked(); +#endif } FORCEINLINE static v8::Local ToV8String(v8::Isolate* Isolate, const char* String)