OpenTTD Source 20250426-master-gbb1d561369
|
Handling of UTF-8 encoded data. More...
Go to the source code of this file.
Data Structures | |
class | Utf8View |
Constant span of UTF-8 encoded data. More... | |
class | Utf8View::iterator |
Bidirectional input iterator over codepoints. More... | |
Functions | |
std::pair< char[4], size_t > | EncodeUtf8 (char32_t c) |
Encode a character to UTF-8. | |
std::pair< size_t, char32_t > | DecodeUtf8 (std::string_view buf) |
Decode a character from UTF-8. | |
bool | IsUtf8Part (char c) |
Handling of UTF-8 encoded data.
Definition in file utf8.hpp.
std::pair< size_t, char32_t > DecodeUtf8 | ( | std::string_view | buf | ) |
Decode a character from UTF-8.
buf | Binary data. |
Definition at line 48 of file utf8.cpp.
References GB(), and HasBit().
Referenced by GlobalVarChangeInfo(), StringConsumer::PeekUtf8(), and VideoDriver_SDL_Base::PollEvent().
std::pair< char[4], size_t > EncodeUtf8 | ( | char32_t | c | ) |
Encode a character to UTF-8.
c | Character |
Definition at line 21 of file utf8.cpp.
References GB().
Referenced by StringConsumer::FindUtf8(), Textbuf::InsertChar(), StringConsumer::PeekUntilUtf8(), BaseStringBuilder::PutUtf8(), StringConsumer::ReadUntilUtf8(), and StringConsumer::SkipUntilUtf8().