rename:更改函数名。
This commit is contained in:
parent
6cada82609
commit
7108d1efa9
@ -242,13 +242,13 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static std::string u8ToGBK(const std::string& str);
|
static std::string u8_to_ansi(const std::string& str);
|
||||||
static std::string GBKTou8(const std::string& str);
|
static std::string ansi_to_u8(const std::string& str);
|
||||||
#endif
|
#endif
|
||||||
/// @brief 删除,段落中的空白字符,如[你好 啊,在 哪里 ?] => [你好啊,在哪里?]
|
/// @brief 删除,段落中的空白字符,如[你好 啊,在 哪里 ?] => [你好啊,在哪里?]
|
||||||
/// 仅处理非 ASCII 码附近的内容。
|
/// 仅处理非 ASCII 码附近的内容。
|
||||||
/// @param str
|
/// @param str
|
||||||
/// @return
|
/// @return
|
||||||
static ofString rbs(const ofString& str);
|
static ofString rbs(const ofString& str);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ ofString OfUtil::get_file_size(long long bytes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#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);
|
int wideCharLen = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, nullptr, 0);
|
||||||
if (wideCharLen <= 0) {
|
if (wideCharLen <= 0) {
|
||||||
@ -131,7 +131,7 @@ std::string CCodec::u8ToGBK(const std::string& str)
|
|||||||
gbkStr.resize(gbkLen - 1);
|
gbkStr.resize(gbkLen - 1);
|
||||||
return gbkStr;
|
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);
|
int wideCharLen = MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, nullptr, 0);
|
||||||
if (wideCharLen <= 0) {
|
if (wideCharLen <= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user