From a95e0e174c48b7c5242b8969aef99838a52c41ee Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 21 Oct 2005 08:12:23 -0400
Subject: [PATCH] Improved support for UTF-8 and other charsets

---
 program/lib/utf8.inc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/program/lib/utf8.inc b/program/lib/utf8.inc
index 72a96b4..43ecb32 100644
--- a/program/lib/utf8.inc
+++ b/program/lib/utf8.inc
@@ -88,7 +88,9 @@
 			$thisPos++;
 		}
 
-		if ($thisLen == 1)
+		if ($decimalCode<128)
+			$encodedLetter = chr($decimalCode);
+		else if ($thisLen == 1)
 			$encodedLetter = "&#". str_pad($decimalCode, 3, "0", STR_PAD_LEFT) . ';';
 		else
 			$encodedLetter = "&#". str_pad($decimalCode, 5, "0", STR_PAD_LEFT) . ';';

--
Gitblit v1.9.1