mirror of https://github.com/kiwix/libkiwix.git
+ small imp.
This commit is contained in:
parent
9d92cec52d
commit
40042efe06
|
@ -4,18 +4,17 @@ using namespace std;
|
||||||
|
|
||||||
/* Remove accent */
|
/* Remove accent */
|
||||||
std::string removeAccents(const char *text = NULL) {
|
std::string removeAccents(const char *text = NULL) {
|
||||||
char* out = NULL;
|
char* out = 0;
|
||||||
size_t out_length = 0;
|
size_t out_length = 0;
|
||||||
|
|
||||||
if (!unac_string("UTF8", text, strlen(text), &out, &out_length)) {
|
if (!unac_string("UTF8", text, strlen(text), &out, &out_length)) {
|
||||||
std::string textWithoutAccent = text;
|
std::string textWithoutAccent = string(out, out_length);
|
||||||
textWithoutAccent = string(out, out_length);
|
|
||||||
free(out);
|
free(out);
|
||||||
return textWithoutAccent;
|
return textWithoutAccent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text != NULL) {
|
if (text != NULL) {
|
||||||
return string(text);
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
|
|
Loading…
Reference in New Issue