mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 07:35:38 +00:00
Added support for filtering UTF-8 strings using UTF8-CPP
This commit is contained in:
parent
b296180af3
commit
d934cfb48f
|
@ -449,6 +449,7 @@ set(COMMON_INCLUDE_DIRS ${CURL_INCLUDE_DIR}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/external/lunasvg/include
|
${CMAKE_CURRENT_SOURCE_DIR}/external/lunasvg/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/external/rapidjson/include
|
${CMAKE_CURRENT_SOURCE_DIR}/external/rapidjson/include
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/external/rlottie/inc
|
${CMAKE_CURRENT_SOURCE_DIR}/external/rlottie/inc
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/external/utfcpp/source
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/es-core/src
|
${CMAKE_CURRENT_SOURCE_DIR}/es-core/src
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/es-pdf-converter/src)
|
${CMAKE_CURRENT_SOURCE_DIR}/es-pdf-converter/src)
|
||||||
|
|
||||||
|
|
|
@ -569,6 +569,13 @@ namespace Utils
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string filterUtf8(const std::string& stringArg)
|
||||||
|
{
|
||||||
|
std::string tempString;
|
||||||
|
utf8::replace_invalid(stringArg.begin(), stringArg.end(), back_inserter(tempString));
|
||||||
|
return tempString;
|
||||||
|
}
|
||||||
|
|
||||||
std::string trim(const std::string& stringArg)
|
std::string trim(const std::string& stringArg)
|
||||||
{
|
{
|
||||||
std::string trimString = stringArg;
|
std::string trimString = stringArg;
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "utf8.h"
|
||||||
|
|
||||||
namespace Utils
|
namespace Utils
|
||||||
{
|
{
|
||||||
namespace String
|
namespace String
|
||||||
|
@ -28,6 +30,7 @@ namespace Utils
|
||||||
std::string toLower(const std::string& stringArg);
|
std::string toLower(const std::string& stringArg);
|
||||||
std::string toUpper(const std::string& stringArg);
|
std::string toUpper(const std::string& stringArg);
|
||||||
std::string toCapitalized(const std::string& stringArg);
|
std::string toCapitalized(const std::string& stringArg);
|
||||||
|
std::string filterUtf8(const std::string& stringArg);
|
||||||
std::string trim(const std::string& stringArg);
|
std::string trim(const std::string& stringArg);
|
||||||
std::string replace(const std::string& stringArg,
|
std::string replace(const std::string& stringArg,
|
||||||
const std::string& from,
|
const std::string& from,
|
||||||
|
|
Loading…
Reference in a new issue