Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzFramework::UTF16ToUTF8Converter Class Reference

Class used to convert sequences of UTF-16 code units to UTF-8 code points. More...

#include <InputDeviceKeyboard_WinAPI.h>

Public Member Functions

AZStd::string FeedCodeUnitUTF16 (uint16_t codeUnitUTF16)
 

Detailed Description

Class used to convert sequences of UTF-16 code units to UTF-8 code points.

Member Function Documentation

◆ FeedCodeUnitUTF16()

AZStd::string AzFramework::UTF16ToUTF8Converter::FeedCodeUnitUTF16 ( uint16_t  codeUnitUTF16)
inline

Feed a UTF-16 code unit to the converter

Parameters
[in]codeUnitUTF16The 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: