1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fonts will now correctly detect encoding of fonts from mods

This commit is contained in:
Ivan Savenko
2023-02-25 01:11:42 +02:00
parent 4260726e4b
commit 9b428e8231
5 changed files with 128 additions and 46 deletions

View File

@@ -14,6 +14,12 @@ VCMI_LIB_NAMESPACE_BEGIN
/// Namespace that provides utilites for unicode support (UTF-8)
namespace TextOperations
{
/// returns 32-bit UTF codepoint for UTF-8 character symbol
uint32_t DLL_LINKAGE getUnicodeCodepoint(const char *data, size_t maxSize);
/// returns 32-bit UTF codepoint for character symbol in selected single-byte encoding
uint32_t DLL_LINKAGE getUnicodeCodepoint(char data, const std::string & encoding );
/// returns length (in bytes) of UTF-8 character starting from specified character
size_t DLL_LINKAGE getUnicodeCharacterSize(char firstByte);