TianoCore EDK2 master
Loading...
Searching...
No Matches
BaseUcs2Utf8Lib.h File Reference

Go to the source code of this file.

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

Definition in file BaseUcs2Utf8Lib.h.

Macro Definition Documentation

◆ UNICODE_FORMAT_CHAR_LEN

#define UNICODE_FORMAT_CHAR_LEN   2

Definition at line 18 of file BaseUcs2Utf8Lib.h.

◆ UNICODE_FORMAT_CHAR_SIZE

#define UNICODE_FORMAT_CHAR_SIZE   3

Definition at line 19 of file BaseUcs2Utf8Lib.h.

◆ UNICODE_FORMAT_LEN

#define UNICODE_FORMAT_LEN   6

L"\u0000"

Definition at line 17 of file BaseUcs2Utf8Lib.h.

◆ UTF8_BUFFER_FOR_UCS2_MAX_SIZE

#define UTF8_BUFFER_FOR_UCS2_MAX_SIZE   3

Definition at line 21 of file BaseUcs2Utf8Lib.h.

Function Documentation

◆ UCS2StrToUTF8()

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.

Definition at line 266 of file BaseUcs2Utf8Lib.c.

◆ UTF8StrToUCS2()

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.

Definition at line 327 of file BaseUcs2Utf8Lib.c.