diff --git a/exec/load/tdfonts_lib.js b/exec/load/tdfonts_lib.js
index 7878793b00ed4084808f1dc9b674768ceda1c632..29ed44d72d78db711722b76b32e1df87cb314725 100644
--- a/exec/load/tdfonts_lib.js
+++ b/exec/load/tdfonts_lib.js
@@ -280,7 +280,7 @@ function readchar(i, font) { // glyph argument is no longer needed, we return th
 }
 
 
-function lookupchar(c, font) {
+function lookupchar_code(c, font) {
     var char_code = c.charCodeAt(0); // Get the ASCII value of the character
     for (var i = 0; i < NUM_CHARS; i++) {
         // We need to find the index `i` in `charlist` that corresponds to `c`.
@@ -297,6 +297,14 @@ function lookupchar(c, font) {
     return -1; // Character not found in charlist
 }
 
+// Lookup the uppercase char if lowercase char not mapped to font
+function lookupchar(c, font) {
+	var result = lookupchar_code(c, font);
+	if (result == -1)
+		result = lookupchar_code(c.toUpperCase(), font);
+	return result;
+}
+
 // ibmtoutf8 function (using system.text_to_utf8 as a replacement for iconv)
 // This function's logic is now integrated into readchar.