RedfishPkg[all]  1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BaseUcs2Utf8Lib.h File Reference

Macros

#define UNICODE_FORMAT_LEN   6
 
#define UNICODE_FORMAT_CHAR_LEN   2
 
#define UNICODE_FORMAT_CHAR_SIZE   3
 
#define UTF8_BUFFER_FOR_UCS2_MAX_SIZE   3
 

Functions

EFI_STATUS UCS2StrToUTF8 (IN CHAR16 *Ucs2Str, OUT CHAR8 **Utf8StrAddr)
 
EFI_STATUS UTF8StrToUCS2 (IN CHAR8 *Utf8Str, OUT CHAR16 **Ucs2StrAddr)
 

Detailed Description

UCS2 to UTF8 manipulation library header file.

Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent

Macro Definition Documentation

#define UNICODE_FORMAT_CHAR_LEN   2
#define UNICODE_FORMAT_CHAR_SIZE   3
#define UNICODE_FORMAT_LEN   6

L"\u0000"

#define UTF8_BUFFER_FOR_UCS2_MAX_SIZE   3

Function Documentation

EFI_STATUS UCS2StrToUTF8 ( IN CHAR16 *  Ucs2Str,
OUT CHAR8 **  Utf8StrAddr 
)

Convert a UCS2 string to a UTF8 encoded string.

Parameters
[in]Ucs2StrThe provided UCS2 string.
[out]Utf8StrAddrThe converted UTF8 string address. Caller is responsible for Free this string.
Return values
EFI_INVALID_PARAMETEROne or more parameters are invalid.
EFI_OUT_OF_RESOURCESSystem runs out of resources.
EFI_SUCCESSThe UTF8 encoded string has been converted.
EFI_STATUS UTF8StrToUCS2 ( IN CHAR8 *  Utf8Str,
OUT CHAR16 **  Ucs2StrAddr 
)

Convert a UTF8 encoded string to a UCS2 string.

Parameters
[in]Utf8StrThe provided UTF8 encoded string.
[out]Ucs2StrAddrThe converted UCS2 string address. Caller is responsible for Free this string.
Return values
EFI_INVALID_PARAMETERThe UTF8 encoded string is not valid to convert to UCS2 string. One or more parameters are invalid.
EFI_OUT_OF_RESOURCESSystem runs out of resources.
EFI_SUCCESSThe UCS2 string has been converted.