Try %a for ASCII
-----Original Message-----
From: Stephen Polkowski [mailto:[email protected]]
Sent: Monday, March 25, 2013 4:02 PM
To: [email protected]
Subject: [edk2] AsciiPrint() and %s
Hello,
I'm trying to print a simple ASCII string to the console. I decided to
try
AsciiPrint() from the MDE package. I started having problems right away. The
function wouldn't print an Ascii string. Here's my code:
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/ShellCEntryLib.h>
INTN EFIAPI ShellAppMain (IN UINTN Argc, IN CHAR16 **Argv) {
char world[] = "world";
AsciiPrint("hello %s\n", world);
return 0;
}
After some digging around, I noticed that AsciiPrint calls the
BasePrintLibSPrintMarker function which defaults to Unicode for %s. Is this
correct? The documentation for AsciiPrint in the MDE document states that it
will print a formatted ASCII string to the console. However, it makes no
mention of the type of strings supported in the VA list. In my mind it should
be supporting ASCII. Is this a bug or the intended behavior?
Thanks,
Stephen
BasePrintLib/PrintLibInternal.c:
case 's':
case 'S':
Flags |= ARGUMENT_UNICODE;
//
// break skipped on purpose
//
case 'a':
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013 Rise to greatness in
Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game on Steam. $5K
grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel