Remove one extra dependency. Qt has some bugs on the text codec it seems, but it is also important to keep the behavior aligned with the client API.
25 lines
537 B
C++
25 lines
537 B
C++
#include <mbgl/platform/platform.hpp>
|
|
|
|
#include <QByteArray>
|
|
#include <QString>
|
|
|
|
#include <string>
|
|
|
|
namespace mbgl {
|
|
namespace platform {
|
|
|
|
std::string uppercase(const std::string& str) {
|
|
auto upper = QString::fromUtf8(str.c_str()).toUpper().toUtf8();
|
|
|
|
return std::string(upper.constData(), upper.size());
|
|
}
|
|
|
|
std::string lowercase(const std::string& str) {
|
|
auto lower = QString::fromUtf8(str.c_str()).toLower().toUtf8();
|
|
|
|
return std::string(lower.constData(), lower.size());
|
|
}
|
|
|
|
} // namespace platform
|
|
} // namespace mbgl
|