Remove implicit cast from CFX_WideString to (const wchar_t*)

BUG=

Review URL: https://codereview.chromium.org/1882043004
diff --git a/core/fpdfdoc/doc_formfield.cpp b/core/fpdfdoc/doc_formfield.cpp
index 957352e..7f0ff87 100644
--- a/core/fpdfdoc/doc_formfield.cpp
+++ b/core/fpdfdoc/doc_formfield.cpp
@@ -724,7 +724,8 @@
       return -1;
   }
 
-  CFX_ByteString csStr = PDF_EncodeText(csOptLabel, csOptLabel.GetLength());
+  CFX_ByteString csStr =
+      PDF_EncodeText(csOptLabel.c_str(), csOptLabel.GetLength());
   CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");
   CPDF_Array* pOpt = ToArray(pValue);
   if (!pOpt) {
diff --git a/core/fxcrt/extension.h b/core/fxcrt/extension.h
index a9f3c23..a8a099c 100644
--- a/core/fxcrt/extension.h
+++ b/core/fxcrt/extension.h
@@ -52,7 +52,7 @@
   void GetPath(CFX_WideString& wsPath) override { wsPath = m_path; }
 
   IFX_FileStream* CreateFileStream(uint32_t dwModes) override {
-    return FX_CreateFileStream(m_path, dwModes);
+    return FX_CreateFileStream(m_path.c_str(), dwModes);
   }
 
   FX_BOOL Init(const CFX_WideStringC& wsPath) {
diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp
index 8036837..8c52307 100644
--- a/core/fxcrt/fx_arabic.cpp
+++ b/core/fxcrt/fx_arabic.cpp
@@ -221,7 +221,7 @@
   FXSYS_assert(iStart > -1 && iStart < wsText.GetLength());
   FXSYS_assert(iCount >= 0 && iStart + iCount <= wsText.GetLength());
   FX_WCHAR wch;
-  FX_WCHAR* pStart = (FX_WCHAR*)(const FX_WCHAR*)wsText;
+  FX_WCHAR* pStart = const_cast<FX_WCHAR*>(wsText.c_str());
   pStart += iStart;
   FX_WCHAR* pEnd = pStart + iCount - 1;
   while (pStart < pEnd) {
@@ -252,7 +252,7 @@
                      FX_BOOL bWS) {
   FXSYS_assert(wsText.GetLength() == classes.GetSize());
   int32_t iCount = wsText.GetLength();
-  const FX_WCHAR* pwsStart = (const FX_WCHAR*)wsText;
+  const FX_WCHAR* pwsStart = wsText.c_str();
   FX_WCHAR wch;
   int32_t iCls;
   if (bWS) {
diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h
index 4b73551..9d7d667 100644
--- a/core/fxcrt/include/fx_string.h
+++ b/core/fxcrt/include/fx_string.h
@@ -497,10 +497,6 @@
   // Note: Any subsequent modification of |this| will invalidate the result.
   const FX_WCHAR* c_str() const { return m_pData ? m_pData->m_String : L""; }
 
-  // Implicit conversion to C-style wide string -- deprecated.
-  // Note: Any subsequent modification of |this| will invalidate the result.
-  operator const FX_WCHAR*() const { return m_pData ? m_pData->m_String : L""; }
-
   // Explicit conversion to CFX_WideStringC.
   // Note: Any subsequent modification of |this| will invalidate the result.
   CFX_WideStringC AsStringC() const {
diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp
index bfeba0e..288a2fe 100644
--- a/fpdfsdk/fsdk_baseform.cpp
+++ b/fpdfsdk/fsdk_baseform.cpp
@@ -718,7 +718,7 @@
     case FIELDTYPE_COMBOBOX: {
       FX_BOOL bFormated = FALSE;
       CFX_WideString sValue = OnFormat(bFormated);
-      ResetAppearance(bFormated ? sValue : nullptr, TRUE);
+      ResetAppearance(bFormated ? sValue.c_str() : nullptr, TRUE);
     } break;
     default:
       ResetAppearance(nullptr, FALSE);
@@ -1546,7 +1546,7 @@
     CFX_WideString sValueTmp;
     if (!sValue && GetMixXFAWidget()) {
       sValueTmp = GetValue(TRUE);
-      sValue = sValueTmp;
+      sValue = sValueTmp.c_str();
     }
 #endif  // PDF_ENABLE_XFA
 
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index d03f671..9f7b60f 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -1654,7 +1654,7 @@
   }
   CFX_WideString ws = params[0].ToCFXWideString();
   ws.Replace(L",", L".");
-  vRet = ws;
+  vRet = ws.c_str();
   vRet.MaybeCoerceToNumber();
   if (vRet.GetType() != CJS_Value::VT_number)
     vRet = 0;
diff --git a/fpdfsdk/javascript/public_methods_embeddertest.cpp b/fpdfsdk/javascript/public_methods_embeddertest.cpp
index 153b3cd..1fc967b 100644
--- a/fpdfsdk/javascript/public_methods_embeddertest.cpp
+++ b/fpdfsdk/javascript/public_methods_embeddertest.cpp
@@ -113,56 +113,56 @@
 
   // 1968-06-25
   formatted_date = CJS_PublicMethods::MakeFormatDate(-47952000000, L"ddmmyy");
-  EXPECT_STREQ(L"250668", formatted_date);
+  EXPECT_STREQ(L"250668", formatted_date.c_str());
   formatted_date = CJS_PublicMethods::MakeFormatDate(-47952000000, L"yy/mm/dd");
-  EXPECT_STREQ(L"68/06/25", formatted_date);
+  EXPECT_STREQ(L"68/06/25", formatted_date.c_str());
 
   // 1969-12-31
   formatted_date = CJS_PublicMethods::MakeFormatDate(-0.0001, L"ddmmyy");
-  EXPECT_STREQ(L"311269", formatted_date);
+  EXPECT_STREQ(L"311269", formatted_date.c_str());
   formatted_date = CJS_PublicMethods::MakeFormatDate(-0.0001, L"yy!mmdd");
-  EXPECT_STREQ(L"69!1231", formatted_date);
+  EXPECT_STREQ(L"69!1231", formatted_date.c_str());
 
   // 1970-01-01
   formatted_date = CJS_PublicMethods::MakeFormatDate(0, L"ddmmyy");
-  EXPECT_STREQ(L"010170", formatted_date);
+  EXPECT_STREQ(L"010170", formatted_date.c_str());
   formatted_date = CJS_PublicMethods::MakeFormatDate(0, L"mm-yyyy-dd");
-  EXPECT_STREQ(L"01-1970-01", formatted_date);
+  EXPECT_STREQ(L"01-1970-01", formatted_date.c_str());
 
   // 1985-12-31
   formatted_date = CJS_PublicMethods::MakeFormatDate(504835200000.0, L"ddmmyy");
-  EXPECT_STREQ(L"311285", formatted_date);
+  EXPECT_STREQ(L"311285", formatted_date.c_str());
   formatted_date = CJS_PublicMethods::MakeFormatDate(504835200000.0, L"yymmdd");
-  EXPECT_STREQ(L"851231", formatted_date);
+  EXPECT_STREQ(L"851231", formatted_date.c_str());
 
   // 1995-02-01
   formatted_date = CJS_PublicMethods::MakeFormatDate(791596800000.0, L"ddmmyy");
-  EXPECT_STREQ(L"010295", formatted_date);
+  EXPECT_STREQ(L"010295", formatted_date.c_str());
   formatted_date =
       CJS_PublicMethods::MakeFormatDate(791596800000.0, L"yyyymmdd");
-  EXPECT_STREQ(L"19950201", formatted_date);
+  EXPECT_STREQ(L"19950201", formatted_date.c_str());
 
   // 2005-02-01
   formatted_date =
       CJS_PublicMethods::MakeFormatDate(1107216000000.0, L"ddmmyy");
-  EXPECT_STREQ(L"010205", formatted_date);
+  EXPECT_STREQ(L"010205", formatted_date.c_str());
   formatted_date =
       CJS_PublicMethods::MakeFormatDate(1107216000000.0, L"yyyyddmm");
-  EXPECT_STREQ(L"20050102", formatted_date);
+  EXPECT_STREQ(L"20050102", formatted_date.c_str());
 
   // 2085-12-31
   formatted_date =
       CJS_PublicMethods::MakeFormatDate(3660595200000.0, L"ddmmyy");
-  EXPECT_STREQ(L"311285", formatted_date);
+  EXPECT_STREQ(L"311285", formatted_date.c_str());
   formatted_date =
       CJS_PublicMethods::MakeFormatDate(3660595200000.0, L"yyyydd");
-  EXPECT_STREQ(L"208531", formatted_date);
+  EXPECT_STREQ(L"208531", formatted_date.c_str());
 
   // 2095-02-01
   formatted_date =
       CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"ddmmyy");
-  EXPECT_STREQ(L"010295", formatted_date);
+  EXPECT_STREQ(L"010295", formatted_date.c_str());
   formatted_date =
       CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"mmddyyyy");
-  EXPECT_STREQ(L"02012095", formatted_date);
+  EXPECT_STREQ(L"02012095", formatted_date.c_str());
 }
diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp
index adaa9c7..4f2d834 100644
--- a/fpdfsdk/javascript/util.cpp
+++ b/fpdfsdk/javascript/util.cpp
@@ -312,7 +312,8 @@
     sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
     return FALSE;
   }
-  vRet = printx(params[0].ToCFXWideString(), params[1].ToCFXWideString());
+  vRet =
+      printx(params[0].ToCFXWideString(), params[1].ToCFXWideString()).c_str();
   return TRUE;
 }
 
diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp
index d93a756..60283a6 100644
--- a/xfa/fde/css/fde_cssstyleselector.cpp
+++ b/xfa/fde/css/fde_cssstyleselector.cpp
@@ -570,7 +570,8 @@
         } else if (iLen > 0) {
           psz = pSyntax->GetCurrentString(iLen);
           if (iLen > 0) {
-            pDecl->AddProperty(&args, wsName, wsName.GetLength(), psz, iLen);
+            pDecl->AddProperty(&args, wsName.c_str(), wsName.GetLength(), psz,
+                               iLen);
           }
         }
       } else {
diff --git a/xfa/fde/css/fde_cssstylesheet.cpp b/xfa/fde/css/fde_cssstylesheet.cpp
index 3da7cf4..4afb0ce 100644
--- a/xfa/fde/css/fde_cssstylesheet.cpp
+++ b/xfa/fde/css/fde_cssstylesheet.cpp
@@ -264,8 +264,9 @@
         } else if (iValueLen > 0) {
           pszValue = pSyntax->GetCurrentString(iValueLen);
           if (iValueLen > 0) {
-            pStyleRule->GetDeclImp().AddProperty(
-                &propertyArgs, wsName, wsName.GetLength(), pszValue, iValueLen);
+            pStyleRule->GetDeclImp().AddProperty(&propertyArgs, wsName.c_str(),
+                                                 wsName.GetLength(), pszValue,
+                                                 iValueLen);
           }
         }
         break;
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index d846abc..8e9c30e 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -624,7 +624,7 @@
     return;
   }
   ExpandBuffer(iLength, 1);
-  const FX_WCHAR* pStr = (const FX_WCHAR*)m_wsEllipsis;
+  const FX_WCHAR* pStr = m_wsEllipsis.c_str();
   int32_t* pCharWidths = m_pEllCharWidths;
   uint32_t dwBreakStatus;
   FX_WCHAR wch;
@@ -873,7 +873,7 @@
   }
 }
 void CFDE_TextOut::ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect) {
-  const FX_WCHAR* pwsStr = (const FX_WCHAR*)m_wsText;
+  const FX_WCHAR* pwsStr = m_wsText.c_str();
   FX_BOOL bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
   int32_t iPieceWidths = 0;
   FDE_LPTTOPIECE pPiece = pLine->GetPtrAt(0);
@@ -990,7 +990,7 @@
 void CFDE_TextOut::ToTextRun(const FDE_LPTTOPIECE pPiece, FX_TXTRUN& tr) {
   tr.pAccess = NULL;
   tr.pIdentity = NULL;
-  tr.pStr = (const FX_WCHAR*)m_wsText + pPiece->iStartChar;
+  tr.pStr = (m_wsText + pPiece->iStartChar).c_str();
   tr.pWidths = m_pCharWidths + pPiece->iStartChar;
   tr.iLength = pPiece->iChars;
   tr.pFont = m_pFont;
diff --git a/xfa/fde/xml/fde_xml_imp.cpp b/xfa/fde/xml/fde_xml_imp.cpp
index 25c4c5a..f678cf5 100644
--- a/xfa/fde/xml/fde_xml_imp.cpp
+++ b/xfa/fde/xml/fde_xml_imp.cpp
@@ -397,10 +397,10 @@
           ws += L"UTF-8";
         }
         ws += L"\"?>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       } else {
-        ws.Format(L"<?%s", (const FX_WCHAR*)pInstruction->m_wsTarget);
-        pXMLStream->WriteString(ws, ws.GetLength());
+        ws.Format(L"<?%s", pInstruction->m_wsTarget.c_str());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
         CFX_WideStringArray& attributes = pInstruction->m_Attributes;
         int32_t i, iCount = attributes.GetSize();
         CFX_WideString wsValue;
@@ -416,7 +416,7 @@
           wsValue.Replace(L"\"", L"&quot;");
           ws += wsValue;
           ws += L"\"";
-          pXMLStream->WriteString(ws, ws.GetLength());
+          pXMLStream->WriteString(ws.c_str(), ws.GetLength());
         }
         CFX_WideStringArray& targetdata = pInstruction->m_TargetData;
         iCount = targetdata.GetSize();
@@ -424,17 +424,17 @@
           ws = L" \"";
           ws += targetdata[i];
           ws += L"\"";
-          pXMLStream->WriteString(ws, ws.GetLength());
+          pXMLStream->WriteString(ws.c_str(), ws.GetLength());
         }
         ws = L"?>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       }
     } break;
     case FDE_XMLNODE_Element: {
       CFX_WideString ws;
       ws = L"<";
       ws += ((CFDE_XMLElement*)pNode)->m_wsTag;
-      pXMLStream->WriteString(ws, ws.GetLength());
+      pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       CFX_WideStringArray& attributes = ((CFDE_XMLElement*)pNode)->m_Attributes;
       int32_t iCount = attributes.GetSize();
       CFX_WideString wsValue;
@@ -450,14 +450,14 @@
         wsValue.Replace(L"\"", L"&quot;");
         ws += wsValue;
         ws += L"\"";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       }
       if (pNode->m_pChild == NULL) {
         ws = L"\n/>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       } else {
         ws = L"\n>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
         CFDE_XMLNode* pChild = pNode->m_pChild;
         while (pChild != NULL) {
           pChild->SaveXMLNode(pXMLStream);
@@ -466,7 +466,7 @@
         ws = L"</";
         ws += ((CFDE_XMLElement*)pNode)->m_wsTag;
         ws += L"\n>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       }
     } break;
     case FDE_XMLNODE_Text: {
@@ -476,13 +476,13 @@
       ws.Replace(L">", L"&gt;");
       ws.Replace(L"\'", L"&apos;");
       ws.Replace(L"\"", L"&quot;");
-      pXMLStream->WriteString(ws, ws.GetLength());
+      pXMLStream->WriteString(ws.c_str(), ws.GetLength());
     } break;
     case FDE_XMLNODE_CharData: {
       CFX_WideString ws = L"<![CDATA[";
       ws += ((CFDE_XMLCharData*)pNode)->m_wsCharData;
       ws += L"]]>";
-      pXMLStream->WriteString(ws, ws.GetLength());
+      pXMLStream->WriteString(ws.c_str(), ws.GetLength());
     } break;
     case FDE_XMLNODE_Unknown:
       break;
@@ -580,7 +580,7 @@
   int32_t iCount = m_Attributes.GetSize();
   for (int32_t i = 0; i < iCount; i += 2) {
     if (m_Attributes[i].Compare(pwsAttriName) == 0) {
-      return FXSYS_wtoi((const FX_WCHAR*)m_Attributes[i + 1]);
+      return FXSYS_wtoi(m_Attributes[i + 1].c_str());
     }
   }
   return iDefValue;
@@ -596,7 +596,7 @@
   int32_t iCount = m_Attributes.GetSize();
   for (int32_t i = 0; i < iCount; i += 2) {
     if (m_Attributes[i].Compare(pwsAttriName) == 0) {
-      return FX_wcstof((const FX_WCHAR*)m_Attributes[i + 1]);
+      return FX_wcstof(m_Attributes[i + 1].c_str());
     }
   }
   return fDefValue;
@@ -700,11 +700,11 @@
       break;
     }
     CFDE_XMLElement* pElement = (CFDE_XMLElement*)pNode;
-    if (!pElement->HasAttribute(wsAttri)) {
+    if (!pElement->HasAttribute(wsAttri.c_str())) {
       pNode = pNode->GetNodeItem(CFDE_XMLNode::Parent);
       continue;
     }
-    pElement->GetString(wsAttri, wsNamespace);
+    pElement->GetString(wsAttri.c_str(), wsNamespace);
     break;
   }
 }
@@ -766,7 +766,7 @@
   int32_t iCount = m_Attributes.GetSize();
   for (int32_t i = 0; i < iCount; i += 2) {
     if (m_Attributes[i].Compare(pwsAttriName) == 0) {
-      return FXSYS_wtoi((const FX_WCHAR*)m_Attributes[i + 1]);
+      return FXSYS_wtoi(m_Attributes[i + 1].c_str());
     }
   }
   return iDefValue;
@@ -782,7 +782,7 @@
   int32_t iCount = m_Attributes.GetSize();
   for (int32_t i = 0; i < iCount; i += 2) {
     if (m_Attributes[i].Compare(pwsAttriName) == 0) {
-      return FX_wcstof((const FX_WCHAR*)m_Attributes[i + 1]);
+      return FX_wcstof(m_Attributes[i + 1].c_str());
     }
   }
   return fDefValue;
@@ -955,10 +955,10 @@
           ws += L"UTF-8";
         }
         ws += L"\"?>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       } else {
-        ws.Format(L"<?%s", (const FX_WCHAR*)pInstruction->m_wsTarget);
-        pXMLStream->WriteString(ws, ws.GetLength());
+        ws.Format(L"<?%s", pInstruction->m_wsTarget.c_str());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
         CFX_WideStringArray& attributes = pInstruction->m_Attributes;
         int32_t i, iCount = attributes.GetSize();
         CFX_WideString wsValue;
@@ -974,7 +974,7 @@
           wsValue.Replace(L"\"", L"&quot;");
           ws += wsValue;
           ws += L"\"";
-          pXMLStream->WriteString(ws, ws.GetLength());
+          pXMLStream->WriteString(ws.c_str(), ws.GetLength());
         }
         CFX_WideStringArray& targetdata = pInstruction->m_TargetData;
         iCount = targetdata.GetSize();
@@ -982,17 +982,17 @@
           ws = L" \"";
           ws += targetdata[i];
           ws += L"\"";
-          pXMLStream->WriteString(ws, ws.GetLength());
+          pXMLStream->WriteString(ws.c_str(), ws.GetLength());
         }
         ws = L"?>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       }
     } break;
     case FDE_XMLNODE_Element: {
       CFX_WideString ws;
       ws = L"<";
       ws += ((CFDE_XMLElement*)pNode)->m_wsTag;
-      pXMLStream->WriteString(ws, ws.GetLength());
+      pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       CFX_WideStringArray& attributes = ((CFDE_XMLElement*)pNode)->m_Attributes;
       int32_t iCount = attributes.GetSize();
       CFX_WideString wsValue;
@@ -1008,14 +1008,14 @@
         wsValue.Replace(L"\"", L"&quot;");
         ws += wsValue;
         ws += L"\"";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       }
       if (pNode->m_pChild == NULL) {
         ws = L"\n/>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       } else {
         ws = L"\n>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
         CFDE_XMLNode* pChild = pNode->m_pChild;
         while (pChild != NULL) {
           SaveXMLNode(pXMLStream, static_cast<CFDE_XMLNode*>(pChild));
@@ -1024,7 +1024,7 @@
         ws = L"</";
         ws += ((CFDE_XMLElement*)pNode)->m_wsTag;
         ws += L"\n>";
-        pXMLStream->WriteString(ws, ws.GetLength());
+        pXMLStream->WriteString(ws.c_str(), ws.GetLength());
       }
     } break;
     case FDE_XMLNODE_Text: {
@@ -1034,13 +1034,13 @@
       ws.Replace(L">", L"&gt;");
       ws.Replace(L"\'", L"&apos;");
       ws.Replace(L"\"", L"&quot;");
-      pXMLStream->WriteString(ws, ws.GetLength());
+      pXMLStream->WriteString(ws.c_str(), ws.GetLength());
     } break;
     case FDE_XMLNODE_CharData: {
       CFX_WideString ws = L"<![CDATA[";
       ws += ((CFDE_XMLCharData*)pNode)->m_wsCharData;
       ws += L"]]>";
-      pXMLStream->WriteString(ws, ws.GetLength());
+      pXMLStream->WriteString(ws.c_str(), ws.GetLength());
     } break;
     case FDE_XMLNODE_Unknown:
       break;
diff --git a/xfa/fee/fde_txtedtengine.cpp b/xfa/fee/fde_txtedtengine.cpp
index b98f1e1..ac3c74f 100644
--- a/xfa/fee/fde_txtedtengine.cpp
+++ b/xfa/fee/fde_txtedtengine.cpp
@@ -1195,7 +1195,7 @@
     CFX_ArrayTemplate<int32_t> PosArr;
     int32_t nLength = wsText.GetLength();
     int32_t i = 0;
-    FX_WCHAR* lpPos = (FX_WCHAR*)(const FX_WCHAR*)wsText;
+    FX_WCHAR* lpPos = const_cast<FX_WCHAR*>(wsText.c_str());
     for (i = 0; i < nLength; i++, lpPos++) {
       if (*lpPos == m_wLineEnd) {
         *lpPos = wc;
@@ -1226,7 +1226,7 @@
     wsText = wsTemp;
   } else {
     int32_t nLength = wsText.GetLength();
-    FX_WCHAR* lpBuf = (FX_WCHAR*)(const FX_WCHAR*)wsText;
+    FX_WCHAR* lpBuf = const_cast<FX_WCHAR*>(wsText.c_str());
     for (int32_t i = 0; i < nLength; i++, lpBuf++) {
       if (*lpBuf == m_wLineEnd) {
         *lpBuf = wc;
@@ -1527,7 +1527,7 @@
   }
   pTextOut->SetStyles(dwStyle);
   wsText += L"\n";
-  pTextOut->CalcLogicSize(wsText, wsText.GetLength(), rcText);
+  pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), rcText);
   pTextOut->Release();
   wsText.Delete(wsText.GetLength() - 1);
   if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Horz) &&
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp
index 1a3b239..7ee76fa 100644
--- a/xfa/fgas/crt/fgas_stream.cpp
+++ b/xfa/fgas/crt/fgas_stream.cpp
@@ -388,7 +388,7 @@
   FXSYS_assert(pszSrcFileName != NULL && FXSYS_wcslen(pszSrcFileName) > 0);
 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \
     _FX_OS_ == _FX_WIN64_
-  CFX_WideString wsMode;
+  const FX_WCHAR* wsMode;
   if (dwAccess & FX_STREAMACCESS_Write) {
     if (dwAccess & FX_STREAMACCESS_Append) {
       wsMode = L"a+b";
diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp
index 2e550f7..12271fb 100644
--- a/xfa/fgas/font/fgas_fontutils.cpp
+++ b/xfa/fgas/font/fgas_fontutils.cpp
@@ -42,7 +42,7 @@
     wsFont += L"Italic";
   }
   wsFont += wCodePage;
-  return FX_HashCode_String_GetW((const FX_WCHAR*)wsFont, wsFont.GetLength());
+  return FX_HashCode_String_GetW(wsFont.c_str(), wsFont.GetLength());
 }
 static const FGAS_FONTUSB g_FXGdiFontUSBTable[] = {
     {0x0000, 0x007F, 0, 1252},     {0x0080, 0x00FF, 1, 1252},
diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp
index 0ef80a3..ed41076 100644
--- a/xfa/fgas/font/fgas_gefont.cpp
+++ b/xfa/fgas/font/fgas_gefont.cpp
@@ -514,11 +514,11 @@
     CFX_WideString wsFamily;
     GetFamilyName(wsFamily);
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-    IFX_Font* pFont = m_pFontMgr->GetDefFontByUnicode(
-        wUnicode, GetFontStyles(), (const FX_WCHAR*)wsFamily);
+    IFX_Font* pFont = m_pFontMgr->GetDefFontByUnicode(wUnicode, GetFontStyles(),
+                                                      wsFamily.c_str());
 #else
     IFX_Font* pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(),
-                                                   (const FX_WCHAR*)wsFamily);
+                                                   wsFamily.c_str());
     if (NULL == pFont) {
       pFont = m_pFontMgr->GetFontByUnicode(wUnicode, GetFontStyles(), NULL);
     }
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index 89087aa..6e707bf 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -1504,7 +1504,7 @@
 }
 int32_t CFX_FontMgrImp::IsPartName(const CFX_WideString& Name1,
                                    const CFX_WideString& Name2) {
-  if (Name1.Find((const FX_WCHAR*)Name2) != -1) {
+  if (Name1.Find(Name2.c_str()) != -1) {
     return 1;
   }
   return 0;
diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp
index 1ef92f0..dc4b3d2 100644
--- a/xfa/fgas/localization/fgas_locale.cpp
+++ b/xfa/fgas/localization/fgas_locale.cpp
@@ -217,7 +217,7 @@
   CXML_Element* pxmlTimeZone = m_pElement->GetElement("", "timeZone");
   if (pxmlTimeZone) {
     CFX_WideString wsTimeZone = pxmlTimeZone->GetContent(0);
-    FX_ParseTimeZone(wsTimeZone, wsTimeZone.GetLength(), tz);
+    FX_ParseTimeZone(wsTimeZone.c_str(), wsTimeZone.GetLength(), tz);
   }
 }
 void CFX_Locale::GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD) const {
@@ -315,7 +315,7 @@
   int32_t cc = 0;
   bool bNegative = false;
   bool bExpSign = false;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsValue;
+  const FX_WCHAR* str = wsValue.c_str();
   int32_t len = wsValue.GetLength();
   while (cc < len && FX_IsSpace(str[cc]))
     cc++;
@@ -462,7 +462,7 @@
 void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString,
                                          CFX_WideStringArray& wsPatterns) {
   int32_t iStrLen = wsFormatString.GetLength();
-  const FX_WCHAR* pStr = (const FX_WCHAR*)wsFormatString;
+  const FX_WCHAR* pStr = wsFormatString.c_str();
   const FX_WCHAR* pToken = pStr;
   const FX_WCHAR* pEnd = pStr + iStrLen;
   FX_BOOL iQuote = FALSE;
@@ -573,7 +573,7 @@
   FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown;
   int32_t ccf = 0;
   int32_t iLenf = wsPattern.GetLength();
-  const FX_WCHAR* pStr = (const FX_WCHAR*)wsPattern;
+  const FX_WCHAR* pStr = wsPattern.c_str();
   FX_BOOL bBraceOpen = FALSE;
   while (ccf < iLenf) {
     if (pStr[ccf] == '\'') {
@@ -596,7 +596,7 @@
         ccf++;
       }
       uint32_t dwHash =
-          FX_HashCode_String_GetW(wsCategory, wsCategory.GetLength());
+          FX_HashCode_String_GetW(wsCategory.c_str(), wsCategory.GetLength());
       if (dwHash == FX_LOCALECATEGORY_DateHash) {
         if (eCategory == FX_LOCALECATEGORY_Time) {
           return FX_LOCALECATEGORY_DateTime;
@@ -633,13 +633,13 @@
   return (uint16_t)wcstol((wchar_t*)pstrLCID, &pEnd, 16);
 }
 uint16_t CFX_FormatString::GetLCID(const CFX_WideString& wsPattern) {
-  return FX_WStringToLCID(GetLocaleName(wsPattern));
+  return FX_WStringToLCID(GetLocaleName(wsPattern).c_str());
 }
 CFX_WideString CFX_FormatString::GetLocaleName(
     const CFX_WideString& wsPattern) {
   int32_t ccf = 0;
   int32_t iLenf = wsPattern.GetLength();
-  const FX_WCHAR* pStr = (const FX_WCHAR*)wsPattern;
+  const FX_WCHAR* pStr = wsPattern.c_str();
   while (ccf < iLenf) {
     if (pStr[ccf] == '\'') {
       FX_GetLiteralText(pStr, ccf, iLenf);
@@ -661,7 +661,7 @@
   IFX_Locale* pLocale = NULL;
   int32_t ccf = 0;
   int32_t iLenf = wsPattern.GetLength();
-  const FX_WCHAR* pStr = (const FX_WCHAR*)wsPattern;
+  const FX_WCHAR* pStr = wsPattern.c_str();
   FX_BOOL bBrackOpen = FALSE;
   while (ccf < iLenf) {
     if (pStr[ccf] == '\'') {
@@ -717,7 +717,7 @@
   IFX_Locale* pLocale = NULL;
   int32_t ccf = 0;
   int32_t iLenf = wsPattern.GetLength();
-  const FX_WCHAR* pStr = (const FX_WCHAR*)wsPattern;
+  const FX_WCHAR* pStr = wsPattern.c_str();
   FX_BOOL bFindDot = FALSE;
   FX_BOOL bBrackOpen = FALSE;
   while (ccf < iLenf) {
@@ -755,8 +755,8 @@
           while (ccf < iLenf && pStr[ccf] != '(' && pStr[ccf] != '{') {
             wsSubCategory += pStr[ccf++];
           }
-          uint32_t dwSubHash =
-              FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength());
+          uint32_t dwSubHash = FX_HashCode_String_GetW(
+              wsSubCategory.c_str(), wsSubCategory.GetLength());
           FX_LOCALENUMSUBCATEGORY eSubCategory = FX_LOCALENUMPATTERN_Decimal;
           for (int32_t i = 0; i < g_iFXLocaleNumSubCatCount; i++) {
             if (g_FXLocaleNumSubCatData[i].uHash == dwSubHash) {
@@ -816,14 +816,13 @@
                                      int32_t& iDotIndex) {
   int32_t ccf = 0;
   int32_t iLenf = wsNum.GetLength();
-  const FX_WCHAR* pStr = (const FX_WCHAR*)wsNum;
+  const FX_WCHAR* pStr = wsNum.c_str();
   int32_t iLenDot = wsDotSymbol.GetLength();
   while (ccf < iLenf) {
     if (pStr[ccf] == '\'') {
       FX_GetLiteralText(pStr, ccf, iLenf);
     } else if (ccf + iLenDot <= iLenf &&
-               !FXSYS_wcsncmp(pStr + ccf, (const FX_WCHAR*)wsDotSymbol,
-                              iLenDot)) {
+               !FXSYS_wcsncmp(pStr + ccf, wsDotSymbol.c_str(), iLenDot)) {
       iDotIndex = ccf;
       return TRUE;
     }
@@ -849,9 +848,9 @@
     return FALSE;
   }
   int32_t iText = 0, iPattern = 0;
-  const FX_WCHAR* pStrText = (const FX_WCHAR*)wsSrcText;
+  const FX_WCHAR* pStrText = wsSrcText.c_str();
   int32_t iLenText = wsSrcText.GetLength();
-  const FX_WCHAR* pStrPattern = (const FX_WCHAR*)wsTextFormat;
+  const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
   int32_t iLenPattern = wsTextFormat.GetLength();
   while (iPattern < iLenPattern && iText < iLenText) {
     switch (pStrPattern[iPattern]) {
@@ -860,8 +859,7 @@
             FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
         int32_t iLiteralLen = wsLiteral.GetLength();
         if (iText + iLiteralLen > iLenText ||
-            FXSYS_wcsncmp(pStrText + iText, (const FX_WCHAR*)wsLiteral,
-                          iLiteralLen)) {
+            FXSYS_wcsncmp(pStrText + iText, wsLiteral.c_str(), iLiteralLen)) {
           wsValue = wsSrcText;
           return FALSE;
         }
@@ -933,9 +931,9 @@
   pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus);
   int32_t iMinusLen = wsMinus.GetLength();
   int cc = 0, ccf = 0;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsSrcNum;
+  const FX_WCHAR* str = wsSrcNum.c_str();
   int len = wsSrcNum.GetLength();
-  const FX_WCHAR* strf = (const FX_WCHAR*)wsNumFormat;
+  const FX_WCHAR* strf = wsNumFormat.c_str();
   int lenf = wsNumFormat.GetLength();
   double dbRetValue = 0;
   double coeff = 1;
@@ -957,8 +955,8 @@
           CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
           int32_t iLiteralLen = wsLiteral.GetLength();
           cc -= iLiteralLen - 1;
-          if (cc < 0 || FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsLiteral,
-                                      iLiteralLen)) {
+          if (cc < 0 ||
+              FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
             return FALSE;
           }
           cc--;
@@ -995,8 +993,7 @@
             cc--;
           } else {
             cc -= iMinusLen - 1;
-            if (cc < 0 ||
-                FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+            if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
               return FALSE;
             }
             cc--;
@@ -1009,8 +1006,7 @@
             cc--;
           } else {
             cc -= iMinusLen - 1;
-            if (cc < 0 ||
-                FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+            if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
               return FALSE;
             }
             cc--;
@@ -1036,7 +1032,7 @@
               continue;
             } else if (cc - iMinusLen + 1 > 0 &&
                        !FXSYS_wcsncmp(str + (cc - iMinusLen + 1),
-                                      (const FX_WCHAR*)wsMinus, iMinusLen)) {
+                                      wsMinus.c_str(), iMinusLen)) {
               bExpSign = TRUE;
               cc -= iMinusLen;
             } else {
@@ -1053,8 +1049,7 @@
                                      wsSymbol);
           int32_t iSymbolLen = wsSymbol.GetLength();
           cc -= iSymbolLen - 1;
-          if (cc < 0 ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol, iSymbolLen)) {
+          if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
             return FALSE;
           }
           cc--;
@@ -1118,7 +1113,7 @@
           int32_t iSysmbolLen = wsSymbol.GetLength();
           cc -= iSysmbolLen - 1;
           if (cc < 0 ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol, iSysmbolLen)) {
+              FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSysmbolLen)) {
             return FALSE;
           }
           cc--;
@@ -1139,8 +1134,8 @@
           if (cc >= 0) {
             cc -= iGroupLen - 1;
             if (cc >= 0 &&
-                FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsGroupSymbol,
-                              iGroupLen) == 0) {
+                FXSYS_wcsncmp(str + cc, wsGroupSymbol.c_str(), iGroupLen) ==
+                    0) {
               cc--;
             } else {
               cc += iGroupLen - 1;
@@ -1185,8 +1180,7 @@
         CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
         int32_t iLiteralLen = wsLiteral.GetLength();
         cc -= iLiteralLen - 1;
-        if (cc < 0 ||
-            FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsLiteral, iLiteralLen)) {
+        if (cc < 0 || FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
           return FALSE;
         }
         cc--;
@@ -1227,8 +1221,7 @@
           cc--;
         } else {
           cc -= iMinusLen - 1;
-          if (cc < 0 ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+          if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
             return FALSE;
           }
           cc--;
@@ -1241,8 +1234,7 @@
           cc--;
         } else {
           cc -= iMinusLen - 1;
-          if (cc < 0 ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+          if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
             return FALSE;
           }
           cc--;
@@ -1267,8 +1259,8 @@
             cc--;
             continue;
           } else if (cc - iMinusLen + 1 > 0 &&
-                     !FXSYS_wcsncmp(str + (cc - iMinusLen + 1),
-                                    (const FX_WCHAR*)wsMinus, iMinusLen)) {
+                     !FXSYS_wcsncmp(str + (cc - iMinusLen + 1), wsMinus.c_str(),
+                                    iMinusLen)) {
             bExpSign = TRUE;
             cc -= iMinusLen;
           } else {
@@ -1284,8 +1276,7 @@
         pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
         int32_t iSymbolLen = wsSymbol.GetLength();
         cc -= iSymbolLen - 1;
-        if (cc < 0 ||
-            FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol, iSymbolLen)) {
+        if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
           return FALSE;
         }
         cc--;
@@ -1348,8 +1339,7 @@
         pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
         int32_t iSysmbolLen = wsSymbol.GetLength();
         cc -= iSysmbolLen - 1;
-        if (cc < 0 ||
-            FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol, iSysmbolLen)) {
+        if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSysmbolLen)) {
           return FALSE;
         }
         cc--;
@@ -1362,8 +1352,7 @@
         if (cc >= 0) {
           cc -= iGroupLen - 1;
           if (cc >= 0 &&
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsGroupSymbol,
-                            iGroupLen) == 0) {
+              FXSYS_wcsncmp(str + cc, wsGroupSymbol.c_str(), iGroupLen) == 0) {
             cc--;
           } else {
             cc += iGroupLen - 1;
@@ -1410,8 +1399,7 @@
           CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
           int32_t iLiteralLen = wsLiteral.GetLength();
           if (cc + iLiteralLen > len ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsLiteral,
-                            iLiteralLen)) {
+              FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
             return FALSE;
           }
           cc += iLiteralLen;
@@ -1454,7 +1442,7 @@
             cc++;
           } else {
             if (cc + iMinusLen > len ||
-                FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+                FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
               return FALSE;
             }
             bNeg = TRUE;
@@ -1467,7 +1455,7 @@
             cc++;
           } else {
             if (cc + iMinusLen > len ||
-                FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+                FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
               return FALSE;
             }
             bNeg = TRUE;
@@ -1505,7 +1493,7 @@
                                      wsSymbol);
           int32_t iSymbolLen = wsSymbol.GetLength();
           if (cc + iSymbolLen > len ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol, iSymbolLen)) {
+              FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
             return FALSE;
           }
           cc += iSymbolLen;
@@ -1560,8 +1548,7 @@
           pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
           int32_t iSysmbolLen = wsSymbol.GetLength();
           if (cc + iSysmbolLen <= len &&
-              !FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol,
-                             iSysmbolLen)) {
+              !FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSysmbolLen)) {
             cc += iSysmbolLen;
           }
           ccf++;
@@ -1579,8 +1566,7 @@
         } break;
         case ',': {
           if (cc + iGroupLen <= len &&
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsGroupSymbol,
-                            iGroupLen) == 0) {
+              FXSYS_wcsncmp(str + cc, wsGroupSymbol.c_str(), iGroupLen) == 0) {
             cc += iGroupLen;
           }
           ccf++;
@@ -1629,7 +1615,7 @@
 }
 void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult) {
   int32_t iCount = wsNum.GetLength();
-  const FX_WCHAR* pStr = (const FX_WCHAR*)wsNum;
+  const FX_WCHAR* pStr = wsNum.c_str();
   FX_WCHAR* pDst = wsResult.GetBuffer(iCount);
   int32_t nIndex = 0;
   FX_BOOL bMinus = FALSE;
@@ -1699,9 +1685,9 @@
   pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus);
   int32_t iMinusLen = wsMinus.GetLength();
   int cc = 0, ccf = 0;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsSrcNum;
+  const FX_WCHAR* str = wsSrcNum.c_str();
   int len = wsSrcNum.GetLength();
-  const FX_WCHAR* strf = (const FX_WCHAR*)wsNumFormat;
+  const FX_WCHAR* strf = wsNumFormat.c_str();
   int lenf = wsNumFormat.GetLength();
   FX_BOOL bHavePercentSymbol = FALSE;
   FX_BOOL bNeg = FALSE;
@@ -1720,8 +1706,7 @@
         CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
         int32_t iLiteralLen = wsLiteral.GetLength();
         cc -= iLiteralLen - 1;
-        if (cc < 0 ||
-            FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsLiteral, iLiteralLen)) {
+        if (cc < 0 || FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
           return FALSE;
         }
         cc--;
@@ -1759,8 +1744,7 @@
           cc--;
         } else {
           cc -= iMinusLen - 1;
-          if (cc < 0 ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+          if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
             return FALSE;
           }
           cc--;
@@ -1773,8 +1757,7 @@
           cc--;
         } else {
           cc -= iMinusLen - 1;
-          if (cc < 0 ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+          if (cc < 0 || FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
             return FALSE;
           }
           cc--;
@@ -1799,8 +1782,8 @@
             cc--;
             continue;
           } else if (cc - iMinusLen + 1 > 0 &&
-                     !FXSYS_wcsncmp(str + (cc - iMinusLen + 1),
-                                    (const FX_WCHAR*)wsMinus, iMinusLen)) {
+                     !FXSYS_wcsncmp(str + (cc - iMinusLen + 1), wsMinus.c_str(),
+                                    iMinusLen)) {
             bExpSign = TRUE;
             cc -= iMinusLen;
           } else {
@@ -1816,8 +1799,7 @@
         pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
         int32_t iSymbolLen = wsSymbol.GetLength();
         cc -= iSymbolLen - 1;
-        if (cc < 0 ||
-            FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol, iSymbolLen)) {
+        if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
           return FALSE;
         }
         cc--;
@@ -1880,8 +1862,7 @@
         pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
         int32_t iSysmbolLen = wsSymbol.GetLength();
         cc -= iSysmbolLen - 1;
-        if (cc < 0 ||
-            FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol, iSysmbolLen)) {
+        if (cc < 0 || FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSysmbolLen)) {
           return FALSE;
         }
         cc--;
@@ -1894,8 +1875,7 @@
         if (cc >= 0) {
           cc -= iGroupLen - 1;
           if (cc >= 0 &&
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsGroupSymbol,
-                            iGroupLen) == 0) {
+              FXSYS_wcsncmp(str + cc, wsGroupSymbol.c_str(), iGroupLen) == 0) {
             cc--;
           } else {
             cc += iGroupLen - 1;
@@ -1950,8 +1930,7 @@
           CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
           int32_t iLiteralLen = wsLiteral.GetLength();
           if (cc + iLiteralLen > len ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsLiteral,
-                            iLiteralLen)) {
+              FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
             return FALSE;
           }
           cc += iLiteralLen;
@@ -1989,7 +1968,7 @@
             cc++;
           } else {
             if (cc + iMinusLen > len ||
-                FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+                FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
               return FALSE;
             }
             bNeg = TRUE;
@@ -2002,7 +1981,7 @@
             cc++;
           } else {
             if (cc + iMinusLen > len ||
-                FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsMinus, iMinusLen)) {
+                FXSYS_wcsncmp(str + cc, wsMinus.c_str(), iMinusLen)) {
               return FALSE;
             }
             bNeg = TRUE;
@@ -2040,7 +2019,7 @@
                                      wsSymbol);
           int32_t iSymbolLen = wsSymbol.GetLength();
           if (cc + iSymbolLen > len ||
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol, iSymbolLen)) {
+              FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSymbolLen)) {
             return FALSE;
           }
           cc += iSymbolLen;
@@ -2095,8 +2074,7 @@
           pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
           int32_t iSysmbolLen = wsSymbol.GetLength();
           if (cc + iSysmbolLen <= len &&
-              !FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsSymbol,
-                             iSysmbolLen)) {
+              !FXSYS_wcsncmp(str + cc, wsSymbol.c_str(), iSysmbolLen)) {
             cc += iSysmbolLen;
           }
           ccf++;
@@ -2113,8 +2091,7 @@
         } break;
         case ',': {
           if (cc + iGroupLen <= len &&
-              FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsGroupSymbol,
-                            iGroupLen) == 0) {
+              FXSYS_wcsncmp(str + cc, wsGroupSymbol.c_str(), iGroupLen) == 0) {
             cc += iGroupLen;
           }
           ccf++;
@@ -2174,7 +2151,7 @@
   FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown;
   int32_t ccf = 0;
   int32_t iLenf = wsPattern.GetLength();
-  const FX_WCHAR* pStr = (const FX_WCHAR*)wsPattern;
+  const FX_WCHAR* pStr = wsPattern.c_str();
   int32_t iFindCategory = 0;
   FX_BOOL bBraceOpen = FALSE;
   while (ccf < iLenf) {
@@ -2232,8 +2209,8 @@
           while (ccf < iLenf && pStr[ccf] != '(' && pStr[ccf] != '{') {
             wsSubCategory += pStr[ccf++];
           }
-          uint32_t dwSubHash =
-              FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength());
+          uint32_t dwSubHash = FX_HashCode_String_GetW(
+              wsSubCategory.c_str(), wsSubCategory.GetLength());
           FX_LOCALEDATETIMESUBCATEGORY eSubCategory =
               FX_LOCALEDATETIMESUBCATEGORY_Medium;
           for (int32_t i = 0; i < g_iFXLocaleDateTimeSubCatCount; i++) {
@@ -2310,16 +2287,16 @@
   int32_t month = 1;
   int32_t day = 1;
   int32_t ccf = 0;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsDate;
+  const FX_WCHAR* str = wsDate.c_str();
   int32_t len = wsDate.GetLength();
-  const FX_WCHAR* strf = (const FX_WCHAR*)wsDatePattern;
+  const FX_WCHAR* strf = wsDatePattern.c_str();
   int32_t lenf = wsDatePattern.GetLength();
   while (cc < len && ccf < lenf) {
     if (strf[ccf] == '\'') {
       CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
       int32_t iLiteralLen = wsLiteral.GetLength();
       if (cc + iLiteralLen > len ||
-          FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsLiteral, iLiteralLen)) {
+          FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
         return FALSE;
       }
       cc += iLiteralLen;
@@ -2388,7 +2365,7 @@
         if (wsMonthNameAbbr.IsEmpty()) {
           continue;
         }
-        if (!FXSYS_wcsncmp((const FX_WCHAR*)wsMonthNameAbbr, str + cc,
+        if (!FXSYS_wcsncmp(wsMonthNameAbbr.c_str(), str + cc,
                            wsMonthNameAbbr.GetLength())) {
           break;
         }
@@ -2405,7 +2382,7 @@
         if (wsMonthName.IsEmpty()) {
           continue;
         }
-        if (!FXSYS_wcsncmp((const FX_WCHAR*)wsMonthName, str + cc,
+        if (!FXSYS_wcsncmp(wsMonthName.c_str(), str + cc,
                            wsMonthName.GetLength())) {
           break;
         }
@@ -2424,7 +2401,7 @@
         if (wsDayNameAbbr.IsEmpty()) {
           continue;
         }
-        if (!FXSYS_wcsncmp((const FX_WCHAR*)wsDayNameAbbr, str + cc,
+        if (!FXSYS_wcsncmp(wsDayNameAbbr.c_str(), str + cc,
                            wsDayNameAbbr.GetLength())) {
           break;
         }
@@ -2440,7 +2417,7 @@
         if (wsDayName == L"") {
           continue;
         }
-        if (!FXSYS_wcsncmp((const FX_WCHAR*)wsDayName, str + cc,
+        if (!FXSYS_wcsncmp(wsDayName.c_str(), str + cc,
                            wsDayName.GetLength())) {
           break;
         }
@@ -2527,9 +2504,9 @@
   uint8_t second = 0;
   uint16_t millisecond = 0;
   int32_t ccf = 0;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsTime;
+  const FX_WCHAR* str = wsTime.c_str();
   int len = wsTime.GetLength();
-  const FX_WCHAR* strf = (const FX_WCHAR*)wsTimePattern;
+  const FX_WCHAR* strf = wsTimePattern.c_str();
   int lenf = wsTimePattern.GetLength();
   FX_BOOL bHasA = FALSE;
   FX_BOOL bPM = FALSE;
@@ -2538,7 +2515,7 @@
       CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
       int32_t iLiteralLen = wsLiteral.GetLength();
       if (cc + iLiteralLen > len ||
-          FXSYS_wcsncmp(str + cc, (const FX_WCHAR*)wsLiteral, iLiteralLen)) {
+          FXSYS_wcsncmp(str + cc, wsLiteral.c_str(), iLiteralLen)) {
         return FALSE;
       }
       cc += iLiteralLen;
@@ -2764,9 +2741,9 @@
   CFX_WideString wsTextFormat;
   GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat);
   int32_t iText = 0, iPattern = 0;
-  const FX_WCHAR* pStrText = (const FX_WCHAR*)wsSrcText;
+  const FX_WCHAR* pStrText = wsSrcText.c_str();
   int32_t iLenText = wsSrcText.GetLength();
-  const FX_WCHAR* pStrPattern = (const FX_WCHAR*)wsTextFormat;
+  const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
   int32_t iLenPattern = wsTextFormat.GetLength();
   while (iPattern < iLenPattern && iText < iLenText) {
     if (pStrPattern[iPattern] == '\'') {
@@ -2774,8 +2751,7 @@
           FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
       int32_t iLiteralLen = wsLiteral.GetLength();
       if (iText + iLiteralLen > iLenText ||
-          FXSYS_wcsncmp(pStrText + iText, (const FX_WCHAR*)wsLiteral,
-                        iLiteralLen)) {
+          FXSYS_wcsncmp(pStrText + iText, wsLiteral.c_str(), iLiteralLen)) {
         return FALSE;
       }
       iText += iLiteralLen;
@@ -2795,9 +2771,9 @@
   CFX_WideString wsTextFormat;
   GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat);
   int32_t iText = 0, iPattern = 0;
-  const FX_WCHAR* pStrText = (const FX_WCHAR*)wsSrcText;
+  const FX_WCHAR* pStrText = wsSrcText.c_str();
   int32_t iLenText = wsSrcText.GetLength();
-  const FX_WCHAR* pStrPattern = (const FX_WCHAR*)wsTextFormat;
+  const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
   int32_t iLenPattern = wsTextFormat.GetLength();
   while (iPattern < iLenPattern && iText < iLenText) {
     if (pStrPattern[iPattern] == '\'') {
@@ -2805,8 +2781,7 @@
           FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
       int32_t iLiteralLen = wsLiteral.GetLength();
       if (iText + iLiteralLen > iLenText ||
-          FXSYS_wcsncmp(pStrText + iText, (const FX_WCHAR*)wsLiteral,
-                        iLiteralLen)) {
+          FXSYS_wcsncmp(pStrText + iText, wsLiteral.c_str(), iLiteralLen)) {
         return FALSE;
       }
       iText += iLiteralLen;
@@ -2834,8 +2809,8 @@
   CFX_WideString wsTextFormat;
   GetTextFormat(wsPattern, FX_WSTRC(L"text"), wsTextFormat);
   int32_t iText = 0, iPattern = 0;
-  const FX_WCHAR* pStrText = (const FX_WCHAR*)wsSrcText;
-  const FX_WCHAR* pStrPattern = (const FX_WCHAR*)wsTextFormat;
+  const FX_WCHAR* pStrText = wsSrcText.c_str();
+  const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
   int32_t iLenPattern = wsTextFormat.GetLength();
   while (iPattern < iLenPattern) {
     switch (pStrPattern[iPattern]) {
@@ -2913,7 +2888,7 @@
     return FALSE;
   }
   int32_t cc = 0, ccf = 0;
-  const FX_WCHAR* strf = (const FX_WCHAR*)wsNumFormat;
+  const FX_WCHAR* strf = wsNumFormat.c_str();
   int lenf = wsNumFormat.GetLength();
   CFX_WideString wsSrcNum = wsInputNum;
   wsSrcNum.TrimLeft('0');
@@ -2983,7 +2958,7 @@
     wsSrcNum.Delete(0, 1);
   }
   FX_BOOL bAddNeg = FALSE;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsSrcNum;
+  const FX_WCHAR* str = wsSrcNum.c_str();
   int len = wsSrcNum.GetLength();
   int dot_index = wsSrcNum.Find('.');
   if (dot_index == -1) {
@@ -3346,7 +3321,7 @@
     return FALSE;
   }
   int32_t cc = 0, ccf = 0;
-  const FX_WCHAR* strf = (const FX_WCHAR*)wsNumFormat;
+  const FX_WCHAR* strf = wsNumFormat.c_str();
   int lenf = wsNumFormat.GetLength();
   double dbOrgRaw = lcNum.GetDouble();
   double dbRetValue = dbOrgRaw;
@@ -3409,7 +3384,7 @@
     wsNumeric.Delete(0, 1);
   }
   FX_BOOL bAddNeg = FALSE;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsNumeric;
+  const FX_WCHAR* str = wsNumeric.c_str();
   int len = wsNumeric.GetLength();
   int dot_index = wsNumeric.Find('.');
   if (dot_index == -1) {
@@ -3766,7 +3741,7 @@
   int32_t day = 1;
   uint16_t wYear = 0;
   int cc_start = 0, cc = 0;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsDate;
+  const FX_WCHAR* str = wsDate.c_str();
   int len = wsDate.GetLength();
   if (len > 10) {
     return FALSE;
@@ -3971,7 +3946,7 @@
   uint8_t month = datetime.GetMonth();
   uint8_t day = datetime.GetDay();
   int32_t ccf = 0;
-  const FX_WCHAR* strf = (const FX_WCHAR*)wsDatePattern;
+  const FX_WCHAR* strf = wsDatePattern.c_str();
   int32_t lenf = wsDatePattern.GetLength();
   while (ccf < lenf) {
     if (strf[ccf] == '\'') {
@@ -4090,7 +4065,7 @@
   uint8_t second = datetime.GetSecond();
   uint16_t millisecond = datetime.GetMillisecond();
   int32_t ccf = 0;
-  const FX_WCHAR* strf = (const FX_WCHAR*)wsTimePattern;
+  const FX_WCHAR* strf = wsTimePattern.c_str();
   int32_t lenf = wsTimePattern.GetLength();
   uint16_t wHour = hour;
   FX_BOOL bPM = FALSE;
@@ -4299,8 +4274,8 @@
                                wsOutput);
     }
   } else {
-    CFX_WideStringC wsSrcDate((const FX_WCHAR*)wsSrcDateTime, iT);
-    CFX_WideStringC wsSrcTime((const FX_WCHAR*)wsSrcDateTime + iT + 1,
+    CFX_WideStringC wsSrcDate(wsSrcDateTime.c_str(), iT);
+    CFX_WideStringC wsSrcTime(wsSrcDateTime.c_str() + iT + 1,
                               wsSrcDateTime.GetLength() - iT - 1);
     if (wsSrcDate.IsEmpty() || wsSrcTime.IsEmpty()) {
       return FALSE;
@@ -4339,7 +4314,7 @@
   CFX_WideString wsTextFormat;
   GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat);
   int32_t iPattern = 0;
-  const FX_WCHAR* pStrPattern = (const FX_WCHAR*)wsTextFormat;
+  const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
   int32_t iLenPattern = wsTextFormat.GetLength();
   while (iPattern < iLenPattern) {
     if (pStrPattern[iPattern] == '\'') {
@@ -4361,7 +4336,7 @@
   CFX_WideString wsTextFormat;
   GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat);
   int32_t iPattern = 0;
-  const FX_WCHAR* pStrPattern = (const FX_WCHAR*)wsTextFormat;
+  const FX_WCHAR* pStrPattern = wsTextFormat.c_str();
   int32_t iLenPattern = wsTextFormat.GetLength();
   while (iPattern < iLenPattern) {
     if (pStrPattern[iPattern] == '\'') {
diff --git a/xfa/fgas/localization/fgas_localemgr.cpp b/xfa/fgas/localization/fgas_localemgr.cpp
index 69b8638..93e5ea0 100644
--- a/xfa/fgas/localization/fgas_localemgr.cpp
+++ b/xfa/fgas/localization/fgas_localemgr.cpp
@@ -29,7 +29,7 @@
       }
       CFX_WideString wsFullPath(pszLocalPath);
       wsFullPath += L"\\" + wsFileName;
-      IFX_FileRead* pRead = FX_CreateFileRead(wsFullPath);
+      IFX_FileRead* pRead = FX_CreateFileRead(wsFullPath.c_str());
       if (!pRead) {
         continue;
       }
@@ -39,7 +39,7 @@
       if (bssp == "http://www.foxitsoftware.com/localization") {
         CFX_WideString wsLCID = pXmlLocale->GetAttrValue("", "lcid");
         wchar_t* pEnd = NULL;
-        uint32_t dwLCID = wcstol(wsLCID, &pEnd, 16);
+        uint32_t dwLCID = wcstol(wsLCID.c_str(), &pEnd, 16);
         if (pLocaleMgr->m_lcid2xml.GetValueAt((void*)(uintptr_t)dwLCID)) {
           delete pXmlLocale;
         } else {
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 9635ae8..d60069b 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -77,7 +77,7 @@
   CFX_Matrix* pMatrix = &pParams->m_matrix;
   pMatrix->Concat(*pGraphics->GetMatrix());
   m_pTextOut->SetMatrix(*pMatrix);
-  m_pTextOut->DrawLogicText(pParams->m_wsText, iLen, pParams->m_rtPart);
+  m_pTextOut->DrawLogicText(pParams->m_wsText.c_str(), iLen, pParams->m_rtPart);
   return TRUE;
 }
 void* CFWL_WidgetTP::GetCapacity(CFWL_ThemePart* pThemePart,
@@ -154,8 +154,8 @@
     return FALSE;
   m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
   m_pTextOut->SetStyles(pParams->m_dwTTOStyles | FDE_TTOSTYLE_ArabicContext);
-  m_pTextOut->CalcLogicSize(pParams->m_wsText, pParams->m_wsText.GetLength(),
-                            rect);
+  m_pTextOut->CalcLogicSize(pParams->m_wsText.c_str(),
+                            pParams->m_wsText.GetLength(), rect);
   return TRUE;
 }
 FWL_ERR CFWL_WidgetTP::Initialize() {
diff --git a/xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp b/xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp
index 644bb57..c39d3c6 100644
--- a/xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp
+++ b/xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp
@@ -99,7 +99,7 @@
 }
 
 void CBC_BufferedImageLuminanceSource::Init(int32_t& e) {
-  IFX_FileRead* fileread = FX_CreateFileRead(m_filename);
+  IFX_FileRead* fileread = FX_CreateFileRead(m_filename.c_str());
   m_pBitmap = CreateDIBSource(fileread);
   if (!m_pBitmap) {
     e = BCExceptionLoadFile;
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index c83895c..27e7795 100644
--- a/xfa/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/fxfa/app/xfa_ffdoc.cpp
@@ -87,10 +87,11 @@
   }
   CFX_WideString wsPDFContent;
   pChunkElement->GetTextData(wsPDFContent);
-  iBufferSize = FX_Base64DecodeW(wsPDFContent, wsPDFContent.GetLength(), NULL);
+  iBufferSize =
+      FX_Base64DecodeW(wsPDFContent.c_str(), wsPDFContent.GetLength(), NULL);
   pByteBuffer = FX_Alloc(uint8_t, iBufferSize + 1);
   pByteBuffer[iBufferSize] = '0';  // FIXME: I bet this is wrong.
-  FX_Base64DecodeW(wsPDFContent, wsPDFContent.GetLength(), pByteBuffer);
+  FX_Base64DecodeW(wsPDFContent.c_str(), wsPDFContent.GetLength(), pByteBuffer);
   return TRUE;
 }
 void XFA_XPDPacket_MergeRootNode(CXFA_Node* pOriginRoot, CXFA_Node* pNewRoot) {
diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp
index 9c627ea..daa5fd6 100644
--- a/xfa/fxfa/app/xfa_ffdocview.cpp
+++ b/xfa/fxfa/app/xfa_ffdocview.cpp
@@ -157,7 +157,7 @@
       pAppProvider->LoadString(XFA_IDS_ValidateLimit, wsLimit);
       if (!wsLimit.IsEmpty()) {
         CFX_WideString wsTemp;
-        wsTemp.Format((const FX_WCHAR*)wsLimit, iRemain);
+        wsTemp.Format(wsLimit.c_str(), iRemain);
         wsMsg += FX_WSTRC(L"\n") + wsTemp;
       }
     }
@@ -792,8 +792,8 @@
     const bool bValueUseContent =
         wsValueRef.IsEmpty() || wsValueRef == FX_WSTRC(L"$");
     CFX_WideString wsValue, wsLabel;
-    uint32_t uValueHash = FX_HashCode_String_GetW(CFX_WideString(wsValueRef),
-                                                  wsValueRef.GetLength());
+    uint32_t uValueHash =
+        FX_HashCode_String_GetW(wsValueRef.c_str(), wsValueRef.GetLength());
     for (int32_t i = 0; i < iCount; i++) {
       CXFA_Object* refObj = rs.nodes[i];
       if (!refObj->IsNode()) {
diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp
index 18af171..b56f24d 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.cpp
+++ b/xfa/fxfa/app/xfa_ffimageedit.cpp
@@ -131,7 +131,7 @@
     return TRUE;
   }
   CFX_WideString wsImage;
-  IFX_FileRead* pFileRead = FX_CreateFileRead(wsFilePath);
+  IFX_FileRead* pFileRead = FX_CreateFileRead(wsFilePath.c_str());
   if (pFileRead) {
     int32_t nDataSize = pFileRead->GetSize();
     if (nDataSize > 0) {
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index 982ee00..3232dbd 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -199,8 +199,7 @@
       pAppProvider->LoadString(XFA_IDS_ValidateNumberError, wsError);
       CFX_WideString wsSomField;
       pAcc->GetNode()->GetSOMExpression(wsSomField);
-      wsMessage.Format(wsError, (const FX_WCHAR*)wsText,
-                       (const FX_WCHAR*)wsSomField);
+      wsMessage.Format(wsError.c_str(), wsText.c_str(), wsSomField.c_str());
       pAppProvider->MsgBox(wsMessage.AsStringC(), wsTitle.AsStringC(),
                            XFA_MBICON_Error, XFA_MB_OK);
     }
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index 4e7da92..fba296c 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -200,7 +200,7 @@
   m_pNode->GetSOMExpression(wsName);
   if (iNameType == 2 && wsName.GetLength() >= 15) {
     CFX_WideStringC wsPre = FX_WSTRC(L"xfa[0].form[0].");
-    if (wsPre == CFX_WideStringC(wsName, wsPre.GetLength())) {
+    if (wsPre == CFX_WideStringC(wsName.c_str(), wsPre.GetLength())) {
       wsName.Delete(0, wsPre.GetLength());
     }
   }
@@ -528,7 +528,7 @@
         GetValidateCaptionName(wsCaptionName, bVersionFlag);
         CFX_WideString wsError;
         pAppProvider->LoadString(XFA_IDS_ValidateNullError, wsError);
-        wsNullMsg.Format(wsError, (const FX_WCHAR*)wsCaptionName);
+        wsNullMsg.Format(wsError.c_str(), wsCaptionName.c_str());
       }
       pAppProvider->MsgBox(wsNullMsg.AsStringC(), wsTitle.AsStringC(),
                            XFA_MBICON_Status, XFA_MB_OK);
@@ -542,8 +542,8 @@
         GetValidateCaptionName(wsCaptionName, bVersionFlag);
         CFX_WideString wsWarning;
         pAppProvider->LoadString(XFA_IDS_ValidateNullWarning, wsWarning);
-        wsNullMsg.Format(wsWarning, (const FX_WCHAR*)wsCaptionName,
-                         (const FX_WCHAR*)wsCaptionName);
+        wsNullMsg.Format(wsWarning.c_str(), wsCaptionName.c_str(),
+                         wsCaptionName.c_str());
       }
       if (pAppProvider->MsgBox(wsNullMsg.AsStringC(), wsTitle.AsStringC(),
                                XFA_MBICON_Warning, XFA_MB_YesNo) == XFA_IDYes) {
@@ -584,18 +584,18 @@
   CFX_WideString wsError;
   if (bVersionFlag) {
     pAppProvider->LoadString(XFA_IDS_ValidateFailed, wsError);
-    wsMessage.Format(wsError, (const FX_WCHAR*)wsCaptionName);
+    wsMessage.Format(wsError.c_str(), wsCaptionName.c_str());
     return;
   }
   if (bError) {
     pAppProvider->LoadString(XFA_IDS_ValidateError, wsError);
-    wsMessage.Format(wsError, (const FX_WCHAR*)wsCaptionName);
+    wsMessage.Format(wsError.c_str(), wsCaptionName.c_str());
     return;
   }
   CFX_WideString wsWarning;
   pAppProvider->LoadString(XFA_IDS_ValidateWarning, wsWarning);
-  wsMessage.Format(wsWarning, (const FX_WCHAR*)wsCaptionName,
-                   (const FX_WCHAR*)wsCaptionName);
+  wsMessage.Format(wsWarning.c_str(), wsCaptionName.c_str(),
+                   wsCaptionName.c_str());
 }
 int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) {
   if (GetClassID() == XFA_ELEMENT_Draw) {
@@ -916,7 +916,7 @@
     pTextOut->SetStyles(dwStyles);
   }
   ((CXFA_FieldLayoutData*)m_pLayoutData)
-      ->m_pTextOut->CalcLogicSize(wsText, wsText.GetLength(), size);
+      ->m_pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), size);
 }
 FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
   if (size.x > 0) {
diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp
index 542fec5..72952a7 100644
--- a/xfa/fxfa/app/xfa_fontmgr.cpp
+++ b/xfa/fxfa/app/xfa_fontmgr.cpp
@@ -1725,8 +1725,8 @@
     _FXM_PLATFORM_ == _FXM_PLATFORM_ANDROID_
   CFX_WideString wsFontNameTemp = wsFontName;
   wsFontNameTemp.Remove(L' ');
-  uint32_t dwCurFontNameHash =
-      FX_HashCode_String_GetW(wsFontNameTemp, wsFontNameTemp.GetLength(), TRUE);
+  uint32_t dwCurFontNameHash = FX_HashCode_String_GetW(
+      wsFontNameTemp.c_str(), wsFontNameTemp.GetLength(), TRUE);
   int32_t iStart = 0;
   int32_t iEnd = sizeof(g_XFAFontsMap) / sizeof(XFA_FONTINFO) - 1;
   int32_t iMid = 0;
@@ -1763,7 +1763,8 @@
                                    uint16_t wCodePage) {
   CFX_WideString wsFontName = wsFontFamily;
   IFX_FontMgr* pFDEFontMgr = hDoc->GetApp()->GetFDEFontMgr();
-  IFX_Font* pFont = pFDEFontMgr->LoadFont(wsFontName, dwFontStyles, wCodePage);
+  IFX_Font* pFont =
+      pFDEFontMgr->LoadFont(wsFontName.c_str(), dwFontStyles, wCodePage);
   if (!pFont) {
     const XFA_FONTINFO* pCurFont =
         XFA_GetFontINFOByFontName(wsFontName.AsStringC());
@@ -1785,7 +1786,7 @@
         }
         CFX_WideString wsReplace =
             CFX_WideString(pReplace, pNameText - pReplace);
-        pFont = pFDEFontMgr->LoadFont(wsReplace, dwStyle, wCodePage);
+        pFont = pFDEFontMgr->LoadFont(wsReplace.c_str(), dwStyle, wCodePage);
         if (pFont) {
           break;
         }
diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp
index 4d987b0..42d0835 100644
--- a/xfa/fxfa/app/xfa_fwltheme.cpp
+++ b/xfa/fxfa/app/xfa_fwltheme.cpp
@@ -161,8 +161,8 @@
       mtPart.Concat(*pMatrix);
     }
     m_pTextOut->SetMatrix(mtPart);
-    m_pTextOut->DrawLogicText(pParams->m_wsText, pParams->m_wsText.GetLength(),
-                              pParams->m_rtPart);
+    m_pTextOut->DrawLogicText(pParams->m_wsText.c_str(),
+                              pParams->m_wsText.GetLength(), pParams->m_rtPart);
     return TRUE;
   }
   CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
@@ -186,8 +186,8 @@
     mtPart.Concat(*pMatrix);
   }
   m_pTextOut->SetMatrix(mtPart);
-  m_pTextOut->DrawLogicText(pParams->m_wsText, pParams->m_wsText.GetLength(),
-                            pParams->m_rtPart);
+  m_pTextOut->DrawLogicText(pParams->m_wsText.c_str(),
+                            pParams->m_wsText.GetLength(), pParams->m_rtPart);
   return TRUE;
 }
 void* CXFA_FWLTheme::GetCapacity(CFWL_ThemePart* pThemePart,
@@ -306,8 +306,8 @@
     m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor);
     m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
     m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
-    m_pTextOut->CalcLogicSize(pParams->m_wsText, pParams->m_wsText.GetLength(),
-                              rect);
+    m_pTextOut->CalcLogicSize(pParams->m_wsText.c_str(),
+                              pParams->m_wsText.GetLength(), rect);
     return TRUE;
   }
   CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
@@ -324,8 +324,8 @@
     return FALSE;
   m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
   m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
-  m_pTextOut->CalcLogicSize(pParams->m_wsText, pParams->m_wsText.GetLength(),
-                            rect);
+  m_pTextOut->CalcLogicSize(pParams->m_wsText.c_str(),
+                            pParams->m_wsText.GetLength(), rect);
   return TRUE;
 }
 CFWL_WidgetTP* CXFA_FWLTheme::GetTheme(IFWL_Widget* pWidget) {
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp
index 1ee0dbe..ce1ce70 100644
--- a/xfa/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/fxfa/app/xfa_textlayout.cpp
@@ -303,7 +303,7 @@
     pXMLElement->GetLocalTagName(wsName);
     tagProvider.SetTagNameObj(wsName);
     uint32_t dwHashCode =
-        FX_HashCode_String_GetW(wsName, wsName.GetLength(), TRUE);
+        FX_HashCode_String_GetW(wsName.c_str(), wsName.GetLength(), TRUE);
     static const int32_t s_iCount = sizeof(s_XFATagName) / sizeof(uint32_t);
     CFX_DSPATemplate<uint32_t> lookup;
     tagProvider.m_bTagAviliable =
@@ -584,7 +584,7 @@
     return FALSE;
   }
   int32_t iLength = wsValue.GetLength();
-  const FX_WCHAR* pTabStops = wsValue;
+  const FX_WCHAR* pTabStops = wsValue.c_str();
   int32_t iCur = 0;
   int32_t iLast = 0;
   CFX_WideString wsAlign;
@@ -640,8 +640,8 @@
         break;
       case XFA_TABSTOPSSTATUS_Location:
         if (ch == ' ') {
-          uint32_t dwHashCode =
-              FX_HashCode_String_GetW(wsAlign, wsAlign.GetLength(), TRUE);
+          uint32_t dwHashCode = FX_HashCode_String_GetW(
+              wsAlign.c_str(), wsAlign.GetLength(), TRUE);
           CXFA_Measurement ms(CFX_WideStringC(pTabStops + iLast, iCur - iLast));
           FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt);
           pTabstopContext->Append(dwHashCode, fPos);
@@ -656,7 +656,7 @@
   }
   if (!wsAlign.IsEmpty()) {
     uint32_t dwHashCode =
-        FX_HashCode_String_GetW(wsAlign, wsAlign.GetLength(), TRUE);
+        FX_HashCode_String_GetW(wsAlign.c_str(), wsAlign.GetLength(), TRUE);
     CXFA_Measurement ms(CFX_WideStringC(pTabStops + iLast, iCur - iLast));
     FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt);
     pTabstopContext->Append(dwHashCode, fPos);
diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h
index c80e4f6..88b29e2 100644
--- a/xfa/fxfa/app/xfa_textlayout.h
+++ b/xfa/fxfa/app/xfa_textlayout.h
@@ -177,8 +177,7 @@
   }
   virtual uint32_t AddRef() { return ++m_dwRefCount; }
 
- public:
-  const FX_WCHAR* GetLinkURL() { return m_pszURLContent; }
+  const FX_WCHAR* GetLinkURL() { return m_pszURLContent.c_str(); }
 
  protected:
   IFX_MEMAllocator* m_pAllocator;
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 68d3a37..ee7e622 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -2123,7 +2123,7 @@
   CFX_WideString wsRet;
   widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
                              XFA_VALUEPICTURE_Display);
-  strLocalDate = FX_UTF8Encode(wsRet, wsRet.GetLength());
+  strLocalDate = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength());
   return TRUE;
 }
 FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis,
@@ -2164,7 +2164,7 @@
   CFX_WideString wsRet;
   widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
                              XFA_VALUEPICTURE_Display);
-  strLocalTime = FX_UTF8Encode(wsRet, wsRet.GetLength());
+  strLocalTime = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength());
   return TRUE;
 }
 FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis,
@@ -2205,7 +2205,7 @@
   CFX_WideString wsRet;
   widgetValue.FormatPatterns(wsRet, wsFormat, pLocale,
                              XFA_VALUEPICTURE_Display);
-  strGMTTime = FX_UTF8Encode(wsRet, wsRet.GetLength());
+  strGMTTime = FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength());
   return TRUE;
 }
 int32_t CXFA_FM2JSContext::DateString2Num(const CFX_ByteStringC& szDateString) {
@@ -2381,7 +2381,7 @@
     pLocale->GetDateTimeSymbols(wsSymbols);
     XFA_FM_AlternateDateTimeSymbols(strRet, wsSymbols, g_sAltTable_Date);
   }
-  strFormat = FX_UTF8Encode(strRet, strRet.GetLength());
+  strFormat = FX_UTF8Encode(strRet.c_str(), strRet.GetLength());
 }
 void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis,
                                            int32_t iStyle,
@@ -2436,7 +2436,7 @@
     pLocale->GetDateTimeSymbols(wsSymbols);
     XFA_FM_AlternateDateTimeSymbols(strRet, wsSymbols, g_sAltTable_Time);
   }
-  strFormat = FX_UTF8Encode(strRet, strRet.GetLength());
+  strFormat = FX_UTF8Encode(strRet.c_str(), strRet.GetLength());
 }
 void CXFA_FM2JSContext::GetStandardDateFormat(FXJSE_HOBJECT hThis,
                                               int32_t iStyle,
@@ -3250,7 +3250,8 @@
       FXJSE_HVALUE returnValue = FXJSE_Value_Create(hruntime);
       javaScript = wsJavaScriptBuf.GetWideString();
       FXJSE_ExecuteScript(
-          hContext, FX_UTF8Encode(javaScript, javaScript.GetLength()).c_str(),
+          hContext,
+          FX_UTF8Encode(javaScript.c_str(), javaScript.GetLength()).c_str(),
           returnValue);
       FXJSE_Value_Set(args.GetReturnValue(), returnValue);
       FXJSE_Value_Release(returnValue);
@@ -3367,7 +3368,7 @@
       unitspanString.MakeLower();
       CFX_WideString wsTypeString =
           CFX_WideString::FromUTF8(unitspanString.AsStringC());
-      const FX_WCHAR* pData = wsTypeString;
+      const FX_WCHAR* pData = wsTypeString.c_str();
       int32_t u = 0;
       int32_t uLen = wsTypeString.GetLength();
       while (*(pData + u) == 0x20 || *(pData + u) == 0x09 ||
@@ -3727,7 +3728,7 @@
 void CXFA_FM2JSContext::DecodeURL(const CFX_ByteStringC& szURLString,
                                   CFX_ByteTextBuf& szResultString) {
   CFX_WideString wsURLString = CFX_WideString::FromUTF8(szURLString);
-  const FX_WCHAR* pData = wsURLString;
+  const FX_WCHAR* pData = wsURLString.c_str();
   int32_t iLen = wsURLString.GetLength();
   int32_t i = 0;
   FX_WCHAR ch = 0;
@@ -3788,7 +3789,7 @@
   int32_t i = 0;
   int32_t iCode = 0;
   FX_WCHAR ch = 0;
-  const FX_WCHAR* pData = wsHTMLString;
+  const FX_WCHAR* pData = wsHTMLString.c_str();
   CFX_WideTextBuf wsResultBuf;
   while (i < iLen) {
     ch = *(pData + i);
@@ -3862,7 +3863,7 @@
   int32_t i = 0;
   int32_t iCode = 0;
   FX_WCHAR ch = 0;
-  const FX_WCHAR* pData = wsXMLString;
+  const FX_WCHAR* pData = wsXMLString.c_str();
   CFX_WideTextBuf wsXMLBuf;
   while (i < iLen) {
     ch = *(pData + i);
@@ -4121,7 +4122,7 @@
   uint32_t ch = 0;
   int32_t iLen = wsHTMLString.GetLength();
   int32_t i = 0;
-  const FX_WCHAR* pData = wsHTMLString;
+  const FX_WCHAR* pData = wsHTMLString.c_str();
   int32_t iIndex = 0;
   CFX_WideString htmlReserve;
   while (i < iLen) {
@@ -4183,7 +4184,7 @@
   int32_t iLength = wsXMLString.GetLength();
   int32_t iIndex = 0;
   int32_t u = 0;
-  const FX_WCHAR* pData = wsXMLString;
+  const FX_WCHAR* pData = wsXMLString.c_str();
   for (u = 0; u < iLength; ++u) {
     ch = *(pData + u);
     switch (ch) {
@@ -4312,7 +4313,7 @@
   }
   patternType = XFA_VT_NULL;
   wsPattern.MakeLower();
-  const FX_WCHAR* pData = wsPattern;
+  const FX_WCHAR* pData = wsPattern.c_str();
   int32_t iLength = wsPattern.GetLength();
   int32_t iIndex = 0;
   FX_BOOL bSingleQuotation = FALSE;
@@ -4442,7 +4443,7 @@
                                    XFA_VALUEPICTURE_Display)) {
       FXJSE_Value_SetUTF8String(
           args.GetReturnValue(),
-          FX_UTF8Encode(wsRet, wsRet.GetLength()).AsStringC());
+          FX_UTF8Encode(wsRet.c_str(), wsRet.GetLength()).AsStringC());
     } else {
       FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
     }
@@ -4522,7 +4523,7 @@
       CFX_WideTextBuf lowStringBuf;
       CFX_WideString wsArgString =
           CFX_WideString::FromUTF8(argString.AsStringC());
-      const FX_WCHAR* pData = wsArgString;
+      const FX_WCHAR* pData = wsArgString.c_str();
       int32_t iLen = argString.GetLength();
       int32_t i = 0;
       int32_t ch = 0;
@@ -5148,7 +5149,7 @@
       CFX_WideTextBuf upperStringBuf;
       CFX_WideString wsArgString =
           CFX_WideString::FromUTF8(argString.AsStringC());
-      const FX_WCHAR* pData = wsArgString;
+      const FX_WCHAR* pData = wsArgString.c_str();
       int32_t iLen = wsArgString.GetLength();
       int32_t i = 0;
       int32_t ch = 0;
@@ -5537,7 +5538,7 @@
     if (bFlags) {
       FXJSE_Value_SetUTF8String(
           args.GetReturnValue(),
-          FX_UTF8Encode(decodedResponse, decodedResponse.GetLength())
+          FX_UTF8Encode(decodedResponse.c_str(), decodedResponse.GetLength())
               .AsStringC());
     } else {
       pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY);
@@ -6146,8 +6147,8 @@
         CFX_WideString wsSomExpression =
             CFX_WideString::FromUTF8(szSomExp.AsStringC());
         pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
-                                          (const FX_WCHAR*)wsPropertyName,
-                                          (const FX_WCHAR*)wsSomExpression);
+                                          wsPropertyName.c_str(),
+                                          wsSomExpression.c_str());
       }
       for (int32_t i = 0; i < iLength - 2; i++) {
         for (int32_t j = 0; j < iSizes[i]; j++) {
@@ -6209,8 +6210,8 @@
         CFX_WideString wsSomExpression =
             CFX_WideString::FromUTF8(szSomExp.AsStringC());
         pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
-                                          (const FX_WCHAR*)wsPropertyName,
-                                          (const FX_WCHAR*)wsSomExpression);
+                                          wsPropertyName.c_str(),
+                                          wsSomExpression.c_str());
       }
     }
     if (argc == 5) {
@@ -6294,8 +6295,8 @@
         CFX_WideString wsSomExpression =
             CFX_WideString::FromUTF8(szSomExp.AsStringC());
         pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
-                                          (const FX_WCHAR*)wsPropertyName,
-                                          (const FX_WCHAR*)wsSomExpression);
+                                          wsPropertyName.c_str(),
+                                          wsSomExpression.c_str());
       }
       for (int32_t i = 0; i < iLength - 2; i++) {
         for (int32_t j = 0; j < iSizes[i]; j++) {
@@ -6356,8 +6357,8 @@
         CFX_WideString wsSomExpression =
             CFX_WideString::FromUTF8(szSomExp.AsStringC());
         pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
-                                          (const FX_WCHAR*)wsPropertyName,
-                                          (const FX_WCHAR*)wsSomExpression);
+                                          wsPropertyName.c_str(),
+                                          wsSomExpression.c_str());
       }
     }
     if (argc == 5) {
@@ -6390,7 +6391,8 @@
         CFX_WideString javaScript = wsJavaScriptBuf.GetWideString();
         FXJSE_Value_SetUTF8String(
             args.GetReturnValue(),
-            FX_UTF8Encode(javaScript, javaScript.GetLength()).AsStringC());
+            FX_UTF8Encode(javaScript.c_str(), javaScript.GetLength())
+                .AsStringC());
       } else {
         pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
       }
@@ -7230,8 +7232,8 @@
   CFX_WideString wsMessage;
   va_list arg_ptr;
   va_start(arg_ptr, iStringID);
-  wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr);
+  wsMessage.FormatV(wsFormat.c_str(), arg_ptr);
   va_end(arg_ptr);
   FXJSE_ThrowMessage(
-      "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsStringC());
+      "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC());
 }
diff --git a/xfa/fxfa/fm2js/xfa_fmparse.cpp b/xfa/fxfa/fm2js/xfa_fmparse.cpp
index e66a42f..c99f015 100644
--- a/xfa/fxfa/fm2js/xfa_fmparse.cpp
+++ b/xfa/fxfa/fm2js/xfa_fmparse.cpp
@@ -964,7 +964,7 @@
   } else {
     CFX_WideString ws_TempString = m_pToken->m_wstring;
     Error(m_pToken->m_uLinenum, FMERR_EXPECTED_TOKEN, L"upto or downto",
-          (const FX_WCHAR*)ws_TempString);
+          ws_TempString.c_str());
   }
   NextToken();
   std::unique_ptr<CXFA_FMSimpleExpression> pAccessor(ParseSimpleExpression());
diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp
index 8579fcb..261ef1f 100644
--- a/xfa/fxfa/parser/cxfa_font.cpp
+++ b/xfa/fxfa/parser/cxfa_font.cpp
@@ -19,14 +19,14 @@
 FX_FLOAT CXFA_Font::GetHorizontalScale() {
   CFX_WideString wsValue;
   m_pNode->TryCData(XFA_ATTRIBUTE_FontHorizontalScale, wsValue);
-  int32_t iScale = FXSYS_wtoi((const FX_WCHAR*)wsValue);
+  int32_t iScale = FXSYS_wtoi(wsValue.c_str());
   return iScale > 0 ? (FX_FLOAT)iScale : 100.0f;
 }
 
 FX_FLOAT CXFA_Font::GetVerticalScale() {
   CFX_WideString wsValue;
   m_pNode->TryCData(XFA_ATTRIBUTE_FontVerticalScale, wsValue);
-  int32_t iScale = FXSYS_wtoi((const FX_WCHAR*)wsValue);
+  int32_t iScale = FXSYS_wtoi(wsValue.c_str());
   return iScale > 0 ? (FX_FLOAT)iScale : 100.0f;
 }
 
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 0a6b506..681516d 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -928,8 +928,8 @@
     return;
 
   m_pNode->GetDocument()->GetNotify()->OnWidgetDataEvent(
-      this, XFA_WIDGETEVENT_ListItemAdded, (void*)(const FX_WCHAR*)wsLabel,
-      (void*)(const FX_WCHAR*)wsValue, (void*)(uintptr_t)nIndex);
+      this, XFA_WIDGETEVENT_ListItemAdded, (void*)wsLabel.c_str(),
+      (void*)wsValue.c_str(), (void*)(uintptr_t)nIndex);
 }
 
 void CXFA_WidgetData::GetItemLabel(const CFX_WideStringC& wsValue,
@@ -1125,7 +1125,7 @@
   CXFA_Node* pUIChild = GetUIChild();
   CFX_WideString wsDataLength;
   if (pUIChild->TryCData(XFA_ATTRIBUTE_DataLength, wsDataLength)) {
-    val = FXSYS_wtoi(wsDataLength);
+    val = FXSYS_wtoi(wsDataLength.c_str());
     return TRUE;
   }
   return FALSE;
@@ -1159,7 +1159,7 @@
   CXFA_Node* pUIChild = GetUIChild();
   CFX_WideString wsECLevel;
   if (pUIChild->TryCData(XFA_ATTRIBUTE_ErrorCorrectionLevel, wsECLevel)) {
-    val = FXSYS_wtoi(wsECLevel);
+    val = FXSYS_wtoi(wsECLevel.c_str());
     return TRUE;
   }
   return FALSE;
@@ -1239,11 +1239,11 @@
     FX_STRSIZE ptPos = wsWideNarrowRatio.Find(':');
     FX_FLOAT fRatio = 0;
     if (ptPos >= 0) {
-      fRatio = (FX_FLOAT)FXSYS_wtoi(wsWideNarrowRatio);
+      fRatio = (FX_FLOAT)FXSYS_wtoi(wsWideNarrowRatio.c_str());
     } else {
       int32_t fA, fB;
-      fA = FXSYS_wtoi(wsWideNarrowRatio.Left(ptPos));
-      fB = FXSYS_wtoi(wsWideNarrowRatio.Mid(ptPos + 1));
+      fA = FXSYS_wtoi(wsWideNarrowRatio.Left(ptPos).c_str());
+      fB = FXSYS_wtoi(wsWideNarrowRatio.Mid(ptPos + 1).c_str());
       if (fB)
         fRatio = (FX_FLOAT)fA / fB;
     }
diff --git a/xfa/fxfa/parser/xfa_basic_imp.cpp b/xfa/fxfa/parser/xfa_basic_imp.cpp
index 07f1b82..112e247 100644
--- a/xfa/fxfa/parser/xfa_basic_imp.cpp
+++ b/xfa/fxfa/parser/xfa_basic_imp.cpp
@@ -599,7 +599,7 @@
   if (iMaxLength > m_wsBuffer.GetLength() - m_iPosition) {
     iMaxLength = m_wsBuffer.GetLength() - m_iPosition;
   }
-  FXSYS_wcsncpy(pStr, (const FX_WCHAR*)m_wsBuffer + m_iPosition, iMaxLength);
+  FXSYS_wcsncpy(pStr, m_wsBuffer.c_str() + m_iPosition, iMaxLength);
   m_iPosition += iMaxLength;
   bEOS = IsEOF();
   return iMaxLength;
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index ea92416..a75a8ea 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -563,8 +563,8 @@
     CXFA_NodeArray& subforms) {
   CFX_WideStringC wsSubformName = pTemplateNode->GetCData(XFA_ATTRIBUTE_Name);
   CFX_WideString wsInstMgrNodeName = FX_WSTRC(L"_") + wsSubformName;
-  uint32_t dwInstNameHash =
-      FX_HashCode_String_GetW(wsInstMgrNodeName, wsInstMgrNodeName.GetLength());
+  uint32_t dwInstNameHash = FX_HashCode_String_GetW(
+      wsInstMgrNodeName.c_str(), wsInstMgrNodeName.GetLength());
   CXFA_Node* pExistingNode = XFA_DataMerge_FindFormDOMInstance(
       pDocument, XFA_ELEMENT_InstanceManager, dwInstNameHash, pFormParent);
   if (pExistingNode) {
diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp
index 9bdee05..2b848ab 100644
--- a/xfa/fxfa/parser/xfa_document_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_imp.cpp
@@ -264,7 +264,7 @@
   CFX_WideStringC wsTemplateURIPrefix =
       XFA_GetPacketByIndex(XFA_PACKET_Template)->pURI;
   FX_STRSIZE nPrefixLength = wsTemplateURIPrefix.GetLength();
-  if (CFX_WideStringC(wsTemplateNS, wsTemplateNS.GetLength()) !=
+  if (CFX_WideStringC(wsTemplateNS.c_str(), wsTemplateNS.GetLength()) !=
       wsTemplateURIPrefix) {
     return XFA_VERSION_UNKNOWN;
   }
@@ -272,10 +272,11 @@
   if (nDotPos == (FX_STRSIZE)-1) {
     return XFA_VERSION_UNKNOWN;
   }
-  int8_t iMajor =
-      FXSYS_wtoi(wsTemplateNS.Mid(nPrefixLength, nDotPos - nPrefixLength));
+  int8_t iMajor = FXSYS_wtoi(
+      wsTemplateNS.Mid(nPrefixLength, nDotPos - nPrefixLength).c_str());
   int8_t iMinor = FXSYS_wtoi(
-      wsTemplateNS.Mid(nDotPos + 1, wsTemplateNS.GetLength() - nDotPos - 2));
+      wsTemplateNS.Mid(nDotPos + 1, wsTemplateNS.GetLength() - nDotPos - 2)
+          .c_str());
   XFA_VERSION eVersion = (XFA_VERSION)((int32_t)iMajor * 100 + iMinor);
   if (eVersion < XFA_VERSION_MIN || eVersion > XFA_VERSION_MAX) {
     return XFA_VERSION_UNKNOWN;
@@ -390,27 +391,25 @@
       if (uSharpPos < 0) {
         wsURI = wsUseVal;
       } else {
-        wsURI = CFX_WideStringC((const FX_WCHAR*)wsUseVal, uSharpPos);
+        wsURI = CFX_WideStringC(wsUseVal.c_str(), uSharpPos);
         FX_STRSIZE uLen = wsUseVal.GetLength();
         if (uLen >= uSharpPos + 5 &&
-            CFX_WideStringC((const FX_WCHAR*)wsUseVal + uSharpPos, 5) ==
+            CFX_WideStringC(wsUseVal.c_str() + uSharpPos, 5) ==
                 FX_WSTRC(L"#som(") &&
             wsUseVal[uLen - 1] == ')') {
-          wsSOM = CFX_WideStringC((const FX_WCHAR*)wsUseVal + uSharpPos + 5,
+          wsSOM = CFX_WideStringC(wsUseVal.c_str() + uSharpPos + 5,
                                   uLen - 1 - uSharpPos - 5);
         } else {
-          wsID = CFX_WideStringC((const FX_WCHAR*)wsUseVal + uSharpPos + 1,
+          wsID = CFX_WideStringC(wsUseVal.c_str() + uSharpPos + 1,
                                  uLen - uSharpPos - 1);
         }
       }
     } else if (pUseHrefNode->TryCData(XFA_ATTRIBUTE_Use, wsUseVal) &&
                !wsUseVal.IsEmpty()) {
       if (wsUseVal[0] == '#') {
-        wsID = CFX_WideStringC((const FX_WCHAR*)wsUseVal + 1,
-                               wsUseVal.GetLength() - 1);
+        wsID = CFX_WideStringC(wsUseVal.c_str() + 1, wsUseVal.GetLength() - 1);
       } else {
-        wsSOM =
-            CFX_WideStringC((const FX_WCHAR*)wsUseVal, wsUseVal.GetLength());
+        wsSOM = CFX_WideStringC(wsUseVal.c_str(), wsUseVal.GetLength());
       }
     }
     if (!wsURI.IsEmpty() && wsURI != FX_WSTRC(L".")) {
diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp
index feaebdd..4c826b6 100644
--- a/xfa/fxfa/parser/xfa_document_serialize.cpp
+++ b/xfa/fxfa/parser/xfa_document_serialize.cpp
@@ -407,7 +407,7 @@
     wsOutput += wsAttr;
   }
   if (!wsOutput.IsEmpty()) {
-    pStream->WriteString((const FX_WCHAR*)wsOutput, wsOutput.GetLength());
+    pStream->WriteString(wsOutput.c_str(), wsOutput.GetLength());
   }
   CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
   if (pChildNode) {
@@ -436,7 +436,7 @@
       static const FX_WCHAR s_pwChecksum[] = L" checksum=\"";
       CFX_WideString wsChecksum = CFX_WideString::FromUTF8(pChecksum);
       pStream->WriteString(s_pwChecksum, FXSYS_wcslen(s_pwChecksum));
-      pStream->WriteString((const FX_WCHAR*)wsChecksum, wsChecksum.GetLength());
+      pStream->WriteString(wsChecksum.c_str(), wsChecksum.GetLength());
       pStream->WriteString(L"\"", 1);
     }
     pStream->WriteString(L" xmlns=\"", FXSYS_wcslen(L" xmlns=\""));
@@ -450,8 +450,7 @@
       wsVersionNumber = FX_WSTRC(L"2.8");
     }
     wsVersionNumber += FX_WSTRC(L"/\"\n>");
-    pStream->WriteString((const FX_WCHAR*)wsVersionNumber,
-                         wsVersionNumber.GetLength());
+    pStream->WriteString(wsVersionNumber.c_str(), wsVersionNumber.GetLength());
     CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);
     while (pChildNode) {
       XFA_DataExporter_RegenerateFormFile_Container(pChildNode, pStream);
diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp
index 57c8054..e36595d 100644
--- a/xfa/fxfa/parser/xfa_localevalue.cpp
+++ b/xfa/fxfa/parser/xfa_localevalue.cpp
@@ -219,7 +219,7 @@
     int32_t nExponent = 0;
     int cc = 0;
     FX_BOOL bNegative = FALSE, bExpSign = FALSE;
-    const FX_WCHAR* str = (const FX_WCHAR*)m_wsValue;
+    const FX_WCHAR* str = m_wsValue.c_str();
     int len = m_wsValue.GetLength();
     while (XFA_IsSpace(str[cc]) && cc < len) {
       cc++;
@@ -294,7 +294,7 @@
     int32_t nExponent = 0;
     int32_t cc = 0;
     FX_BOOL bNegative = FALSE, bExpSign = FALSE;
-    const FX_WCHAR* str = (const FX_WCHAR*)m_wsValue;
+    const FX_WCHAR* str = m_wsValue.c_str();
     int len = m_wsValue.GetLength();
     while (XFA_IsSpace(str[cc]) && cc < len) {
       cc++;
@@ -615,7 +615,7 @@
   uint16_t wYear = 0;
   uint16_t wMonth = 0;
   uint16_t wDay = 0;
-  const FX_WCHAR* pDate = (const FX_WCHAR*)wsDate;
+  const FX_WCHAR* pDate = wsDate.c_str();
   int nIndex = 0, nStart = 0;
   while (pDate[nIndex] != '\0' && nIndex < wCountY) {
     if (!XFA_IsDigit(pDate[nIndex])) {
@@ -701,7 +701,7 @@
   uint16_t wMinute = 0;
   uint16_t wSecond = 0;
   uint16_t wFraction = 0;
-  const FX_WCHAR* pTime = (const FX_WCHAR*)wsTime;
+  const FX_WCHAR* pTime = wsTime.c_str();
   int nIndex = 0;
   int nStart = 0;
   while (nIndex - nStart < wCountH && pTime[nIndex]) {
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 157d7df..87941af 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -71,10 +71,10 @@
   CFX_WideString wsMessage;
   va_list arg_ptr;
   va_start(arg_ptr, iStringID);
-  wsMessage.FormatV((const FX_WCHAR*)wsFormat, arg_ptr);
+  wsMessage.FormatV(wsFormat.c_str(), arg_ptr);
   va_end(arg_ptr);
   FXJSE_ThrowMessage(
-      "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsStringC());
+      "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC());
 }
 
 static void XFA_DeleteWideString(void* pData) {
@@ -753,7 +753,8 @@
     CFX_WideString wsMessage;
     pAppProvider->LoadString(XFA_IDS_Unable_TO_SET, wsMessage);
     FXJSE_ThrowMessage(
-        "", FX_UTF8Encode(wsMessage, wsMessage.GetLength()).AsStringC());
+        "",
+        FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC());
   } else {
     CXFA_AttachNodeList* pNodeList = new CXFA_AttachNodeList(m_pDocument, this);
     FXJSE_Value_SetObject(hValue, (CXFA_Object*)pNodeList,
@@ -1480,11 +1481,9 @@
               ->GetFirstChildByClass(XFA_ELEMENT_Proto);
       if (!wsUseVal.IsEmpty()) {
         if (wsUseVal[0] == '#') {
-          wsID = CFX_WideString((const FX_WCHAR*)wsUseVal + 1,
-                                wsUseVal.GetLength() - 1);
+          wsID = CFX_WideString(wsUseVal.c_str() + 1, wsUseVal.GetLength() - 1);
         } else {
-          wsSOM =
-              CFX_WideString((const FX_WCHAR*)wsUseVal, wsUseVal.GetLength());
+          wsSOM = wsUseVal;
         }
       }
       CXFA_Node* pProtoNode = NULL;
@@ -1527,7 +1526,8 @@
     CFX_WideString wsValue;
     GetAttribute(eAttribute, wsValue);
     FXJSE_Value_SetUTF8String(
-        hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC());
+        hValue,
+        FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
   }
 }
 void CXFA_Node::Script_Attribute_StringRead(FXJSE_HVALUE hValue,
@@ -1537,7 +1537,8 @@
     CFX_WideString wsValue;
     GetAttribute(eAttribute, wsValue);
     FXJSE_Value_SetUTF8String(
-        hValue, FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC());
+        hValue,
+        FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
   } else {
     ThrowScriptErrorMessage(XFA_IDS_INVAlID_PROP_SET);
   }
@@ -1697,13 +1698,14 @@
         classID != XFA_ELEMENT_SubmitUrl) {
       FXJSE_Value_SetNull(hValue);
     } else if (classID == XFA_ELEMENT_Integer) {
-      FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content));
+      FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content.c_str()));
     } else if (classID == XFA_ELEMENT_Float || classID == XFA_ELEMENT_Decimal) {
       CFX_Decimal decimal(content.AsStringC());
       FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
     } else {
       FXJSE_Value_SetUTF8String(
-          hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+          hValue,
+          FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
     }
   }
 }
@@ -1719,7 +1721,8 @@
     FXJSE_Value_SetNull(hValue);
   } else {
     FXJSE_Value_SetUTF8String(
-        hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+        hValue,
+        FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
   }
 }
 void CXFA_Node::Script_Boolean_Value(FXJSE_HVALUE hValue,
@@ -1959,7 +1962,8 @@
       FXJSE_Value_SetNull(hValue);
     } else {
       FXJSE_Value_SetUTF8String(
-          hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+          hValue,
+          FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
     }
   }
 }
@@ -2012,21 +2016,24 @@
         if (eUI == XFA_ELEMENT_NumericEdit &&
             (pNode->GetInteger(XFA_ATTRIBUTE_FracDigits) == -1)) {
           FXJSE_Value_SetUTF8String(
-              hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+              hValue,
+              FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
         } else {
           CFX_Decimal decimal(content.AsStringC());
           FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
         }
       } else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Integer) {
-        FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content));
+        FXJSE_Value_SetInteger(hValue, FXSYS_wtoi(content.c_str()));
       } else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Boolean) {
-        FXJSE_Value_SetBoolean(hValue, FXSYS_wtoi(content) == 0 ? FALSE : TRUE);
+        FXJSE_Value_SetBoolean(hValue,
+                               FXSYS_wtoi(content.c_str()) == 0 ? FALSE : TRUE);
       } else if (pNode && pNode->GetClassID() == XFA_ELEMENT_Float) {
         CFX_Decimal decimal(content.AsStringC());
         FXJSE_Value_SetFloat(hValue, (FX_FLOAT)(double)decimal);
       } else {
         FXJSE_Value_SetUTF8String(
-            hValue, FX_UTF8Encode(content, content.GetLength()).AsStringC());
+            hValue,
+            FX_UTF8Encode(content.c_str(), content.GetLength()).AsStringC());
       }
     }
   }
@@ -2230,7 +2237,7 @@
   if (bHasItem) {
     FXJSE_Value_SetUTF8String(
         pArguments->GetReturnValue(),
-        FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC());
+        FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
   } else {
     FXJSE_Value_SetNull(pArguments->GetReturnValue());
   }
@@ -2308,7 +2315,7 @@
   if (bHasItem) {
     FXJSE_Value_SetUTF8String(
         pArguments->GetReturnValue(),
-        FX_UTF8Encode(wsValue, wsValue.GetLength()).AsStringC());
+        FX_UTF8Encode(wsValue.c_str(), wsValue.GetLength()).AsStringC());
   } else {
     FXJSE_Value_SetNull(pArguments->GetReturnValue());
   }
@@ -2596,8 +2603,8 @@
     CFX_WideString wsLocaleName;
     GetLocaleName(wsLocaleName);
     FXJSE_Value_SetUTF8String(
-        hValue,
-        FX_UTF8Encode(wsLocaleName, wsLocaleName.GetLength()).AsStringC());
+        hValue, FX_UTF8Encode(wsLocaleName.c_str(), wsLocaleName.GetLength())
+                    .AsStringC());
   }
 }
 void CXFA_Node::Script_Subform_ExecEvent(CFXJSE_Arguments* pArguments) {
@@ -2737,8 +2744,8 @@
               pArguments->GetReturnValue(),
               m_pDocument->GetScriptContext()->GetJSValueFromMap(pNewNode));
         } else {
-          ThrowScriptErrorMessage(XFA_IDS_NOT_HAVE_PROPERTY,
-                                  (const FX_WCHAR*)strTagName, L"name");
+          ThrowScriptErrorMessage(XFA_IDS_NOT_HAVE_PROPERTY, strTagName.c_str(),
+                                  L"name");
         }
       } else {
         FXJSE_Value_Set(
@@ -3296,7 +3303,7 @@
                                         : wsInstManagerName.Mid(1);
     uint32_t dInstanceNameHash =
         wsInstanceName.IsEmpty() ? 0 : FX_HashCode_String_GetW(
-                                           wsInstanceName,
+                                           wsInstanceName.c_str(),
                                            wsInstanceName.GetLength());
     CXFA_Node* pPrevSibling =
         (iDesired == 0) ? this
@@ -3492,7 +3499,8 @@
     CFX_WideString wsChecksum;
     GetAttribute(XFA_ATTRIBUTE_Checksum, wsChecksum, FALSE);
     FXJSE_Value_SetUTF8String(
-        hValue, FX_UTF8Encode(wsChecksum, wsChecksum.GetLength()).AsStringC());
+        hValue,
+        FX_UTF8Encode(wsChecksum.c_str(), wsChecksum.GetLength()).AsStringC());
   }
 }
 void CXFA_Node::Script_Packet_GetAttribute(CFXJSE_Arguments* pArguments) {
@@ -3502,13 +3510,13 @@
     CFX_WideString wsAttributeValue;
     CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
     if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) {
-      static_cast<CFDE_XMLElement*>(pXMLNode)
-          ->GetString(CFX_WideString::FromUTF8(bsAttributeName.AsStringC()),
-                      wsAttributeValue);
+      static_cast<CFDE_XMLElement*>(pXMLNode)->GetString(
+          CFX_WideString::FromUTF8(bsAttributeName.AsStringC()).c_str(),
+          wsAttributeValue);
     }
     FXJSE_Value_SetUTF8String(
         pArguments->GetReturnValue(),
-        FX_UTF8Encode(wsAttributeValue, wsAttributeValue.GetLength())
+        FX_UTF8Encode(wsAttributeValue.c_str(), wsAttributeValue.GetLength())
             .AsStringC());
   } else {
     ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
@@ -3540,8 +3548,8 @@
     CFDE_XMLNode* pXMLNode = GetXMLMappingNode();
     if (pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element) {
       CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode);
-      if (pXMLElement->HasAttribute(wsName)) {
-        pXMLElement->RemoveAttribute(wsName);
+      if (pXMLElement->HasAttribute(wsName.c_str())) {
+        pXMLElement->RemoveAttribute(wsName.c_str());
       }
     }
     FXJSE_Value_SetNull(pArguments->GetReturnValue());
@@ -3570,7 +3578,8 @@
       pXMLElement->GetTextData(wsTextData);
     }
     FXJSE_Value_SetUTF8String(
-        hValue, FX_UTF8Encode(wsTextData, wsTextData.GetLength()).AsStringC());
+        hValue,
+        FX_UTF8Encode(wsTextData.c_str(), wsTextData.GetLength()).AsStringC());
   }
 }
 void CXFA_Node::Script_Source_Next(CFXJSE_Arguments* pArguments) {
@@ -3937,7 +3946,7 @@
                             FX_BOOL bNotify,
                             FX_BOOL bScriptModify) {
   void* pKey = XFA_GetMapKey_Element(GetClassID(), eAttr);
-  OnChanging(eAttr, (void*)(const FX_WCHAR*)wsValue, bNotify);
+  OnChanging(eAttr, (void*)wsValue.c_str(), bNotify);
   if (eAttr == XFA_ATTRIBUTE_Value) {
     CFX_WideString* pClone = new CFX_WideString(wsValue);
     SetUserData(pKey, pClone, &deleteWideStringCallBack);
@@ -3946,7 +3955,7 @@
     if (eAttr == XFA_ATTRIBUTE_Name)
       UpdateNameHash();
   }
-  OnChanged(eAttr, (void*)(const FX_WCHAR*)wsValue, bNotify, bScriptModify);
+  OnChanged(eAttr, (void*)wsValue.c_str(), bNotify, bScriptModify);
   if (IsNeedSavingXMLNode() && eAttr != XFA_ATTRIBUTE_QualifiedName &&
       eAttr != XFA_ATTRIBUTE_BindingNode) {
     if (eAttr == XFA_ATTRIBUTE_Name &&
@@ -4006,10 +4015,10 @@
                                      FX_BOOL bNotify,
                                      FX_BOOL bScriptModify) {
   void* pKey = XFA_GetMapKey_Element(GetClassID(), XFA_ATTRIBUTE_Value);
-  OnChanging(XFA_ATTRIBUTE_Value, (void*)(const FX_WCHAR*)wsValue, bNotify);
+  OnChanging(XFA_ATTRIBUTE_Value, (void*)wsValue.c_str(), bNotify);
   CFX_WideString* pClone = new CFX_WideString(wsValue);
   SetUserData(pKey, pClone, &deleteWideStringCallBack);
-  OnChanged(XFA_ATTRIBUTE_Value, (void*)(const FX_WCHAR*)wsValue, bNotify,
+  OnChanged(XFA_ATTRIBUTE_Value, (void*)wsValue.c_str(), bNotify,
             bScriptModify);
   if (IsNeedSavingXMLNode()) {
     FDE_XMLNODETYPE eXMLType = m_pXMLNode->GetType();
diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp
index 5cd28e7..4bb47dd 100644
--- a/xfa/fxfa/parser/xfa_parser_imp.cpp
+++ b/xfa/fxfa/parser/xfa_parser_imp.cpp
@@ -212,8 +212,8 @@
     if (pNode->GetType() != FDE_XMLNODE_Element) {
       continue;
     }
-    if (pNode->HasAttribute(wsNSAttribute)) {
-      pNode->GetString(wsNSAttribute, wsNamespaceURI);
+    if (pNode->HasAttribute(wsNSAttribute.c_str())) {
+      pNode->GetString(wsNSAttribute.c_str(), wsNamespaceURI);
       return TRUE;
     }
   }
@@ -1149,7 +1149,7 @@
           }
           if (!bNeedValue) {
             CFX_WideString wsNilName = FX_WSTRC(L"xsi:nil");
-            pXMLElement->RemoveAttribute(wsNilName);
+            pXMLElement->RemoveAttribute(wsNilName.c_str());
           }
         }
         pXFANode->InsertChild(pXFAChild);
diff --git a/xfa/fxfa/parser/xfa_script_imp.cpp b/xfa/fxfa/parser/xfa_script_imp.cpp
index d92cdc7..84d84bd 100644
--- a/xfa/fxfa/parser/xfa_script_imp.cpp
+++ b/xfa/fxfa/parser/xfa_script_imp.cpp
@@ -181,7 +181,7 @@
       return;
     }
     uint32_t uHashCode =
-        FX_HashCode_String_GetW(wsPropName, wsPropName.GetLength());
+        FX_HashCode_String_GetW(wsPropName.c_str(), wsPropName.GetLength());
     if (uHashCode != XFA_HASHCODE_Layout) {
       CXFA_Object* pObject =
           lpScriptContext->GetDocument()->GetXFAObject(uHashCode);
diff --git a/xfa/fxfa/parser/xfa_script_nodehelper.cpp b/xfa/fxfa/parser/xfa_script_nodehelper.cpp
index 619ba65..1b79ad9 100644
--- a/xfa/fxfa/parser/xfa_script_nodehelper.cpp
+++ b/xfa/fxfa/parser/xfa_script_nodehelper.cpp
@@ -284,13 +284,13 @@
       (bIsProperty && refNode->GetClassID() != XFA_ELEMENT_PageSet)) {
     refNode->GetClassName(wsTagName);
     ws = wsTagName;
-    wsName.Format(L"#%s[%d]", (const FX_WCHAR*)ws,
+    wsName.Format(L"#%s[%d]", ws.c_str(),
                   XFA_GetIndex(refNode, eLogicType, bIsProperty, TRUE));
     return;
   }
   ws = refNode->GetCData(XFA_ATTRIBUTE_Name);
   ws.Replace(L".", L"\\.");
-  wsName.Format(L"%s[%d]", (const FX_WCHAR*)ws,
+  wsName.Format(L"%s[%d]", ws.c_str(),
                 XFA_GetIndex(refNode, eLogicType, bIsProperty, FALSE));
 }
 
diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
index 6ebec5d..09f5137 100644
--- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
+++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp
@@ -96,8 +96,8 @@
     bClassName = TRUE;
     wsName = wsName.Right(wsName.GetLength() - 1);
   }
-  findNode = m_pNodeHelper->XFA_ResolveNodes_GetOneChild(ToNode(rnd.m_CurNode),
-                                                         wsName, bClassName);
+  findNode = m_pNodeHelper->XFA_ResolveNodes_GetOneChild(
+      ToNode(rnd.m_CurNode), wsName.c_str(), bClassName);
   if (findNode == NULL) {
     return 0;
   }
@@ -124,7 +124,7 @@
     return -1;
   }
   uint32_t dwNameHash =
-      FX_HashCode_String_GetW((const FX_WCHAR*)wsName + 1, iNameLen - 1);
+      FX_HashCode_String_GetW(wsName.c_str() + 1, iNameLen - 1);
   if (dwNameHash == XFA_HASHCODE_Xfa) {
     nodes.Add(rnd.m_pSC->GetDocument()->GetRoot());
   } else {
@@ -152,8 +152,8 @@
   rndFind.m_pSC = rnd.m_pSC;
   rndFind.m_CurNode = datasets;
   rndFind.m_wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1);
-  rndFind.m_uHashName =
-      FX_HashCode_String_GetW(rndFind.m_wsName, rndFind.m_wsName.GetLength());
+  rndFind.m_uHashName = FX_HashCode_String_GetW(rndFind.m_wsName.c_str(),
+                                                rndFind.m_wsName.GetLength());
   rndFind.m_nLevel = rnd.m_nLevel + 1;
   rndFind.m_dwStyles = XFA_RESOLVENODE_Children;
   rndFind.m_wsCondition = rnd.m_wsCondition;
@@ -179,8 +179,8 @@
   rndFind.m_dwStyles |= XFA_RESOLVENODE_TagName;
   rndFind.m_dwStyles &= ~XFA_RESOLVENODE_Attributes;
   rndFind.m_wsName = wsName;
-  rndFind.m_uHashName =
-      FX_HashCode_String_GetW(rndFind.m_wsName, rndFind.m_wsName.GetLength());
+  rndFind.m_uHashName = FX_HashCode_String_GetW(rndFind.m_wsName.c_str(),
+                                                rndFind.m_wsName.GetLength());
   rndFind.m_wsCondition = wsCondition;
   rndFind.m_CurNode = curNode;
   XFA_ResolveNodes_Normal(rndFind);
@@ -618,7 +618,7 @@
   wsCondition.ReleaseBuffer(nConditionCount);
   wsCondition.TrimLeft();
   wsCondition.TrimRight();
-  rnd.m_uHashName = FX_HashCode_String_GetW(wsName, wsName.GetLength());
+  rnd.m_uHashName = FX_HashCode_String_GetW(wsName.c_str(), wsName.GetLength());
   return nStart;
 }
 void CXFA_ResolveProcessor::XFA_ResolveNode_ConditionArray(
diff --git a/xfa/fxfa/parser/xfa_utils_imp.cpp b/xfa/fxfa/parser/xfa_utils_imp.cpp
index 1b3dddc..ec7a10c 100644
--- a/xfa/fxfa/parser/xfa_utils_imp.cpp
+++ b/xfa/fxfa/parser/xfa_utils_imp.cpp
@@ -197,7 +197,8 @@
       CFDE_XMLElement* pXMLElement = static_cast<CFDE_XMLElement*>(pXMLNode);
       CFX_WideString wsTag;
       pXMLElement->GetLocalTagName(wsTag);
-      uint32_t uTag = FX_HashCode_String_GetW(wsTag, wsTag.GetLength(), TRUE);
+      uint32_t uTag =
+          FX_HashCode_String_GetW(wsTag.c_str(), wsTag.GetLength(), TRUE);
       if (uTag == 0x0001f714) {
         wsPlainText += L"\n";
       } else if (uTag == 0x00000070) {
@@ -321,7 +322,7 @@
   int32_t nExponent = 0;
   int32_t cc = 0;
   FX_BOOL bNegative = FALSE, bExpSign = FALSE;
-  const FX_WCHAR* str = (const FX_WCHAR*)wsValue;
+  const FX_WCHAR* str = wsValue.c_str();
   int32_t len = wsValue.GetLength();
   if (str[0] == '+') {
     cc++;