Class used to convert sequences of UTF-16 code units to UTF-8 code points.
More...
#include <InputDeviceKeyboard_WinAPI.h>
Class used to convert sequences of UTF-16 code units to UTF-8 code points.
◆ FeedCodeUnitUTF16()
AZStd::string AzFramework::UTF16ToUTF8Converter::FeedCodeUnitUTF16 |
( |
uint16_t |
codeUnitUTF16 | ) |
|
|
inline |
Feed a UTF-16 code unit to the converter
- Parameters
-
[in] | codeUnitUTF16 | The UTF-16 code unit to be converted. The code unit could be a standalone code point, in which case it is converted immediately. Or it could form part of a surrogate pair, in which case we rely on the lead and trailing surrogate being fed to this function in succession before the converted UTF-8 code point can be returned. |
- Returns
- If codeUnitUTF16 is a lead surrogate it is stored internally and an empty string returned. If codeUnitUTF16 is a trailing surrogate and forms a valid surrogate pair with the currently stored lead surrogate, the resulting UTF-16 code point is converted to the corresponding UTF-8 code point, and returned as a UTF-8 encoded string. If codeUnitUTF16 is neither a lead or trailing surrogate, it is converted to the corresponding UTF-8 code point, and returned immediately as a UTF-8 encoded string. Any other case is an encoding error that will result in an empty string being returned.
The documentation for this class was generated from the following file:
- Code/Framework/AzFramework/Platform/Common/WinAPI/AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard_WinAPI.h