mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-12-23 22:47:57 -05:00
+ imp version
This commit is contained in:
@@ -3,15 +3,18 @@
|
||||
using namespace std;
|
||||
|
||||
/* Remove accent */
|
||||
std::string removeAccents(const char *text) {
|
||||
std::string removeAccents(const char *text = NULL) {
|
||||
char* out = 0;
|
||||
size_t out_length = 0;
|
||||
std::string textWithoutAccent = text;
|
||||
|
||||
if (!unac_string("UTF8", text, strlen(text), &out, &out_length)) {
|
||||
std::string textWithoutAccent = text;
|
||||
textWithoutAccent = string(out, out_length);
|
||||
free(out);
|
||||
return textWithoutAccent;
|
||||
} if (text != NULL) {
|
||||
return string(text);
|
||||
}
|
||||
|
||||
return textWithoutAccent;
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user