summaryrefslogtreecommitdiff
path: root/platform/android/src/unaccent.cpp
blob: bc2ec354d6cfcc4e8cf35c495312a576b0a61684 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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