Subject: syslinux: force latin1 encoding on texts used for labels

From: Otavio Salvador <[email-masked]>
Date: Thu, 4 Oct 2007 20:18:04 -0300

syslinux cannot handle utf-8 encoding and then proper encoding needed
to be enforced while printing the label texts.
---
 helpers/lh_binary_syslinux | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/helpers/lh_binary_syslinux b/helpers/lh_binary_syslinux
index 655a424..ca6d7c8 100755
--- a/helpers/lh_binary_syslinux
+++ b/helpers/lh_binary_syslinux
@@ -68,10 +68,17 @@ Restore_cache cache/packages_binary
 Install_package
 
 # Local functions
+Utf8_to_latin1 ()
+{
+	VALUE="${1}"
+
+	echo "${VALUE}" | iconv -f utf-8 -t latin1
+}
+
 Syslinux_memtest_entry ()
 {
 	LABEL="${1}"
-	MENULABEL="${2}"
+	MENULABEL=`Utf8_to_latin1 "${2}"`
 	KERNEL="${3}"
 
 	# syslinux << 3.36 lacks support to file/path
@@ -92,6 +99,7 @@ Syslinux_memtest_entry ()
 Syslinux_live_entry ()
 {
 	LABEL="${1}"
+	MENULABEL=`Utf8_to_latin1 "${2}"`
 	MENULABEL="${2}"
 	KERNEL="${3}"
 	INITRD="${4}"
-- 
cgit v1.0