chore: remove unused Unicode::UTF8ToUCS4
This commit is contained in:
@ -113,29 +113,6 @@ std::string Unicode::UTF8ToUCS2(const std::string &src, bool *errors)
|
|||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Unicode::UTF8ToUCS4(const std::string &src, bool *errors)
|
|
||||||
{
|
|
||||||
// default to success
|
|
||||||
resetError(errors);
|
|
||||||
|
|
||||||
// get size of input string and reserve some space in output
|
|
||||||
auto n = (uint32_t)src.size();
|
|
||||||
std::string dst;
|
|
||||||
dst.reserve(4 * n);
|
|
||||||
|
|
||||||
// convert each character
|
|
||||||
const auto *data = reinterpret_cast<const uint8_t *>(src.c_str());
|
|
||||||
while (n > 0) {
|
|
||||||
uint32_t c = fromUTF8(data, n);
|
|
||||||
if (c == s_invalid) {
|
|
||||||
c = s_replacement;
|
|
||||||
}
|
|
||||||
dst.append(reinterpret_cast<const char *>(&c), 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dst;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Unicode::UTF8ToUTF16(const std::string &src, bool *errors)
|
std::string Unicode::UTF8ToUTF16(const std::string &src, bool *errors)
|
||||||
{
|
{
|
||||||
// default to success
|
// default to success
|
||||||
|
|||||||
@ -36,14 +36,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
static std::string UTF8ToUCS2(const std::string &, bool *errors = nullptr);
|
static std::string UTF8ToUCS2(const std::string &, bool *errors = nullptr);
|
||||||
|
|
||||||
//! Convert from UTF-8 to UCS-4 encoding
|
|
||||||
/*!
|
|
||||||
Convert from UTF-8 to UCS-4. If errors is not nullptr then *errors
|
|
||||||
is set to true iff any character could not be encoded in UCS-4.
|
|
||||||
Decoding errors do not set *errors.
|
|
||||||
*/
|
|
||||||
static std::string UTF8ToUCS4(const std::string &, bool *errors = nullptr);
|
|
||||||
|
|
||||||
//! Convert from UTF-8 to UTF-16 encoding
|
//! Convert from UTF-8 to UTF-16 encoding
|
||||||
/*!
|
/*!
|
||||||
Convert from UTF-8 to UTF-16. If errors is not nullptr then *errors
|
Convert from UTF-8 to UTF-16. If errors is not nullptr then *errors
|
||||||
|
|||||||
Reference in New Issue
Block a user