mirror of https://github.com/kiwix/libkiwix.git
+ android integrates now libicu
This commit is contained in:
parent
39fa510af5
commit
ad20fde08f
|
@ -176,15 +176,10 @@ std::string kiwix::ucFirst (const std::string &word) {
|
|||
|
||||
std::string result;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
result = word;
|
||||
result[0] = toupper(result[0]);
|
||||
#else
|
||||
UnicodeString unicodeWord(word.c_str());
|
||||
UnicodeString unicodeFirstLetter = unicodeWord.tempSubString(0, 1).toUpper();
|
||||
unicodeWord.replace(0, 1, unicodeFirstLetter);
|
||||
unicodeWord.toUTF8String(result);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -195,15 +190,10 @@ std::string kiwix::lcFirst (const std::string &word) {
|
|||
|
||||
std::string result;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
result = word;
|
||||
result[0] = tolower(result[0]);
|
||||
#else
|
||||
UnicodeString unicodeWord(word.c_str());
|
||||
UnicodeString unicodeFirstLetter = unicodeWord.tempSubString(0, 1).toLower();
|
||||
unicodeWord.replace(0, 1, unicodeFirstLetter);
|
||||
unicodeWord.toUTF8String(result);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -215,13 +205,9 @@ std::string kiwix::toTitle (const std::string &word) {
|
|||
|
||||
std::string result;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
result = word;
|
||||
#else
|
||||
UnicodeString unicodeWord(word.c_str());
|
||||
unicodeWord = unicodeWord.toTitle(0);
|
||||
unicodeWord.toUTF8String(result);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#ifndef KIWIX_STRINGTOOLS_H
|
||||
#define KIWIX_STRINGTOOLS_H
|
||||
|
||||
#ifndef __ANDROID__
|
||||
#include <unicode/translit.h>
|
||||
#include <unicode/normlzr.h>
|
||||
#include <unicode/unistr.h>
|
||||
|
@ -29,7 +28,6 @@
|
|||
#include <unicode/uniset.h>
|
||||
#include <unicode/ustring.h>
|
||||
#include <unicode/ucnv.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
|
Loading…
Reference in New Issue