diff --git a/include/of_util.h b/include/of_util.h index 8834554..cba2a0e 100644 --- a/include/of_util.h +++ b/include/of_util.h @@ -242,13 +242,13 @@ public: public: #ifdef _WIN32 - static std::string u8ToGBK(const std::string& str); - static std::string GBKTou8(const std::string& str); + static std::string u8_to_ansi(const std::string& str); + static std::string ansi_to_u8(const std::string& str); #endif /// @brief 删除,段落中的空白字符,如[你好 啊,在 哪里 ?] => [你好啊,在哪里?] /// 仅处理非 ASCII 码附近的内容。 - /// @param str - /// @return + /// @param str + /// @return static ofString rbs(const ofString& str); }; diff --git a/src/of_util.cpp b/src/of_util.cpp index 88a1075..6fc5d55 100644 --- a/src/of_util.cpp +++ b/src/of_util.cpp @@ -113,7 +113,7 @@ ofString OfUtil::get_file_size(long long bytes) } #ifdef _WIN32 -std::string CCodec::u8ToGBK(const std::string& str) +std::string CCodec::u8_to_ansi(const std::string& str) { int wideCharLen = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, nullptr, 0); if (wideCharLen <= 0) { @@ -131,7 +131,7 @@ std::string CCodec::u8ToGBK(const std::string& str) gbkStr.resize(gbkLen - 1); return gbkStr; } -std::string CCodec::GBKTou8(const std::string& str) +std::string CCodec::ansi_to_u8(const std::string& str) { int wideCharLen = MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, nullptr, 0); if (wideCharLen <= 0) {