Rename WideString::{UTF8,UTF16LE}_Encode() to To{UTF8,UTF16LE}().

Make consistent with ToDefANSI().

Change-Id: I576f5a8a2bb3f633c7dca67efd7712fa610acf4d
Reviewed-on: https://pdfium-review.googlesource.com/c/45791
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index 176872f..523d88e 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -413,7 +413,7 @@
                                CFX_GlobalArray* pArray) {
   std::vector<WideString> pKeyList = pRuntime->GetObjectPropertyNames(pObj);
   for (const auto& ws : pKeyList) {
-    ByteString sKey = ws.UTF8Encode();
+    ByteString sKey = ws.ToUTF8();
     v8::Local<v8::Value> v = pRuntime->GetObjectProperty(pObj, ws);
     if (v->IsNumber()) {
       auto pObjElement = pdfium::MakeUnique<CFX_KeyValue>();