How to read UTF8 files?


Konstantin Aladyshev
 

Hello!
What is the best way to handle files encoded in UTF8?
I'm looking for ways to read strings from such files, print these
strings or compare them to my own CHAR16* strings.

For example if I have read a UTF8 string to a buffer via `ShellReadFile` call:
EFI_STATUS
EFIAPI
ShellReadFile(
IN SHELL_FILE_HANDLE FileHandle,
IN OUT UINTN *ReadSize,
OUT VOID *Buffer
);
How to print this string? Print function has only options for ASCII
(%a) or UTF16 (%s) strings.

Best regards,
Konstantin Aladyshev

Join discuss@edk2.groups.io to automatically receive all group messages.