ShellPkg: Do not write the UNICODE BOM on ConOut.
When UNICODE data is being written to ConOut, skip over any BOM that is present at the beginning of the buffer to be written (that is, do not output the BOM to the screen). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jim Dailey <[email protected]> --- ShellPkg/Application/Shell/FileHandleWrappers.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c b/ShellPkg/Application/Shell/FileHandleWrappers.c index f8306e2..ecad500 100644 --- a/ShellPkg/Application/Shell/FileHandleWrappers.c +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c @@ -160,9 +160,11 @@ FileInterfaceStdOutWrite( { if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut) { return (EFI_UNSUPPORTED); - } else { - return (gST->ConOut->OutputString(gST->ConOut, Buffer)); } + if (*((CHAR16 *)Buffer) == gUnicodeFileTag) { + return (gST->ConOut->OutputString(gST->ConOut, (CHAR16 *)Buffer + 1)); + } + return (gST->ConOut->OutputString(gST->ConOut, Buffer)); } /** -- 2.7.1.windows.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

