aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-01-09 15:40:27 +0000
committerMatt Fleming <matt.fleming@intel.com>2013-01-09 15:44:20 +0000
commita90d4b73e7b487b6a907edecea36af735b6ef512 (patch)
tree38cb634f265b1a06df520d38d8b92add290eeb39
parent627ec7915b7c770b55c37777c42b1a82eea733b8 (diff)
downloadsyslinux-a90d4b73e7b487b6a907edecea36af735b6ef512.tar.gz
syslinux-a90d4b73e7b487b6a907edecea36af735b6ef512.tar.xz
syslinux-a90d4b73e7b487b6a907edecea36af735b6ef512.zip
efi: Lookup the Unicode encoding when writing characters
We should be using the system's codepage to lookup the correct Unicode character when writing characters to the output. This allows us to seemlessly print the correct Unicode character given an extended ASCII character, e.g. when drawing boxes in the menu code. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--efi/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/efi/main.c b/efi/main.c
index 4ac4fda3..cb0f98dc 100644
--- a/efi/main.c
+++ b/efi/main.c
@@ -1,3 +1,4 @@
+#include <codepage.h>
#include <core.h>
#include <fs.h>
#include <com32.h>
@@ -105,8 +106,10 @@ void efi_write_char(uint8_t ch, uint8_t attribute)
uefi_call_wrapper(out->SetAttribute, 2, out, attribute);
- c[0] = ch;
+ /* Lookup primary Unicode encoding in the system codepage */
+ c[0] = codepage.uni[0][ch];
c[1] = '\0';
+
uefi_call_wrapper(out->OutputString, 2, out, c);
}