[syslinux:firmware] efi: Lookup the Unicode encoding when writing characters

syslinux-bot for Matt Fleming matt.fleming at intel.com
Fri Jan 11 01:33:11 PST 2013


Commit-ID:  a90d4b73e7b487b6a907edecea36af735b6ef512
Gitweb:     http://www.syslinux.org/commit/a90d4b73e7b487b6a907edecea36af735b6ef512
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Wed, 9 Jan 2013 15:40:27 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Wed, 9 Jan 2013 15:44:20 +0000

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 at intel.com>

---
 efi/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/efi/main.c b/efi/main.c
index 4ac4fda..cb0f98d 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);
 }
 


More information about the Syslinux-commits mailing list