Add libiconv support

This commit is contained in:
2021-12-17 19:32:59 +08:00
parent ed18d79b97
commit 6913d75ba6
8 changed files with 291 additions and 0 deletions

15
str_util.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "str_util.h"
#include "cstr_util.h"
#include <malloc.h>
bool str_util::tolowercase(std::string ori, std::string& result) {
char* tmp = nullptr;
auto re = cstr_tolowercase(ori.c_str(), ori.length(), &tmp);
if (re) {
result = std::string(tmp, ori.length());
free(tmp);
return true;
} else {
return false;
}
}