[android] - replace platform default implementation using nunicode for uppercasing an lowercasing with an Android specific String.java equivalent

This commit is contained in:
tobrun
2018-07-27 14:00:55 +02:00
committed by Tobrun
parent 2fccdecfb1
commit 6e171a62a9
11 changed files with 148 additions and 7 deletions

View File

@@ -0,0 +1,18 @@
#include <unaccent.hpp>
#include <string>
#include "attach_env.hpp"
#include "text/collator_jni.hpp"
#include <jni/jni.hpp>
namespace mbgl {
namespace platform {
std::string unaccent(const std::string& str) {
android::UniqueEnv env = android::AttachEnv();
jni::Local<jni::String> input = jni::Make<jni::String>(*env, str);
jni::Local<jni::String> unaccented = android::StringUtils::unaccent(*env, input);
return jni::Make<std::string>(*env, unaccented);
}
} // namespace platform
} // namespace mbgl