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.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/core/fxcrt/fx_basic_utf.cpp b/core/fxcrt/fx_basic_utf.cpp
index 1bcae61fe9..8a5587d5c4 100644
--- a/core/fxcrt/fx_basic_utf.cpp
+++ b/core/fxcrt/fx_basic_utf.cpp
@@ -59,46 +59,6 @@ class CFX_UTF8Encoder {
} // namespace
-void CFX_UTF8Decoder::Clear() {
- m_Buffer.Clear();
- m_PendingBytes = 0;
-}
-
-void CFX_UTF8Decoder::AppendCodePoint(uint32_t ch) {
- m_Buffer.AppendChar(static_cast<wchar_t>(ch));
-}
-
-void CFX_UTF8Decoder::Input(uint8_t byte) {
- if (byte < 0x80) {
- m_PendingBytes = 0;
- m_Buffer.AppendChar(byte);
- } else if (byte < 0xc0) {
- if (m_PendingBytes == 0) {
- return;
- }
- m_PendingBytes--;
- m_PendingChar |= (byte & 0x3f) << (m_PendingBytes * 6);
- if (m_PendingBytes == 0) {
- AppendCodePoint(m_PendingChar);
- }
- } else if (byte < 0xe0) {
- m_PendingBytes = 1;
- m_PendingChar = (byte & 0x1f) << 6;
- } else if (byte < 0xf0) {
- m_PendingBytes = 2;
- m_PendingChar = (byte & 0x0f) << 12;
- } else if (byte < 0xf8) {
- m_PendingBytes = 3;
- m_PendingChar = (byte & 0x07) << 18;
- } else if (byte < 0xfc) {
- m_PendingBytes = 4;
- m_PendingChar = (byte & 0x03) << 24;
- } else if (byte < 0xfe) {
- m_PendingBytes = 5;
- m_PendingChar = (byte & 0x01) << 30;
- }
-}
-
CFX_ByteString FX_UTF8Encode(const CFX_WideStringC& wsStr) {
FX_STRSIZE len = wsStr.GetLength();
const wchar_t* pStr = wsStr.unterminated_c_str();