+ small imp.

This commit is contained in:
kelson42 2009-11-15 17:26:17 +00:00
parent 8346cc7a23
commit c19ad61051
2 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,7 @@ using namespace std;
/* Remove accent */
std::string removeAccents(const char *text = NULL) {
char* out = 0;
char* out = NULL;
size_t out_length = 0;
if (!unac_string("UTF8", text, strlen(text), &out, &out_length)) {
@ -12,7 +12,9 @@ std::string removeAccents(const char *text = NULL) {
textWithoutAccent = string(out, out_length);
free(out);
return textWithoutAccent;
} if (text != NULL) {
}
if (text != NULL) {
return string(text);
}

View File

@ -3,5 +3,6 @@
#include <stdio.h>
#include <unac.h>
#include <string.h>
#include <iostream>
std::string removeAccents(const char *text);