Avoid more default ANSI strings in fxjs.
Treat everything as UTF-8/16/WideString when originated in V8.
Change-Id: Ib7beee3428f62893673dc8fa4d12ae6374e7701a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/93790
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index 2bd3eaa..ff8f49a 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -759,7 +759,7 @@
if (!m_bCanSet)
return CJS_Result::Failure(JSMessage::kReadOnlyError);
- ByteString byte_str = pRuntime->ToWideString(vp).ToDefANSI();
+ ByteString byte_str = pRuntime->ToByteString(vp);
if (m_bDelay) {
AddDelay_String(FP_BORDERSTYLE, byte_str);
} else {
@@ -1886,8 +1886,7 @@
csBCaption = "check";
break;
}
- return CJS_Result::Success(pRuntime->NewString(
- WideString::FromDefANSI(csBCaption.AsStringView()).AsStringView()));
+ return CJS_Result::Success(pRuntime->NewString(csBCaption.AsStringView()));
}
CJS_Result CJS_Field::set_style(CJS_Runtime* pRuntime,
@@ -1983,7 +1982,7 @@
if (!m_bCanSet)
return CJS_Result::Failure(JSMessage::kReadOnlyError);
- if (pRuntime->ToWideString(vp).ToDefANSI().IsEmpty())
+ if (pRuntime->ToByteString(vp).IsEmpty())
return CJS_Result::Failure(JSMessage::kValueError);
return CJS_Result::Success();
}