summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic_utf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_basic_utf.cpp')
-rw-r--r--core/fxcrt/fx_basic_utf.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fxcrt/fx_basic_utf.cpp b/core/fxcrt/fx_basic_utf.cpp
index 8dbbb28877..c0f14c8178 100644
--- a/core/fxcrt/fx_basic_utf.cpp
+++ b/core/fxcrt/fx_basic_utf.cpp
@@ -73,13 +73,13 @@ void CFX_UTF8Encoder::Input(FX_WCHAR unicode) {
}
}
}
-CFX_ByteString FX_UTF8Encode(const FX_WCHAR* pwsStr, FX_STRSIZE len) {
- if (len < 0)
- len = FXSYS_wcslen(pwsStr);
+CFX_ByteString FX_UTF8Encode(const CFX_WideStringC& wsStr) {
+ FX_STRSIZE len = wsStr.GetLength();
+ const FX_WCHAR* pStr = wsStr.c_str();
CFX_UTF8Encoder encoder;
while (len-- > 0)
- encoder.Input(*pwsStr++);
+ encoder.Input(*pStr++);
return CFX_ByteString(encoder.GetResult());
}