diff --git a/sieve/tests/encoded-character.sieve b/sieve/tests/encoded-character.sieve
index f9972a5055741e5254dcb7ac931a3d6c7c698abb..1fb5b4692b4647cbaef8bbad629306593466c1e0 100644
--- a/sieve/tests/encoded-character.sieve
+++ b/sieve/tests/encoded-character.sieve
@@ -7,5 +7,5 @@ if address :contains "from" "idiot.com" {
 } elsif header :contains "subject" "idiot" {
 	fileinto "INBOX.${hex: 49 44 49 4F 54}";
 } else {
-	fileinto "INBOX.${unicode: 0052 00e6}vh${unicode: 00f8 006c}";
+	fileinto "INBOX.${unicode: 0052 00E6}vh${unicode: 00F8 006C}";
 }
diff --git a/src/lib-sieve/ext-encoded-character.c b/src/lib-sieve/ext-encoded-character.c
index a213c086bddbb5e4472cfe0a7c13ca8086e56c4a..96f017897595bd5f4a5915cbc35d56d3efc9acac 100644
--- a/src/lib-sieve/ext-encoded-character.c
+++ b/src/lib-sieve/ext-encoded-character.c
@@ -59,7 +59,8 @@ static bool _skip_whitespace
 			continue;
 		}
 		
-		if ( **in != ' ' && **in != '\n' ) /* Loose LF is non-standard */
+		/* (Loose LF is non-standard) */
+		if ( **in != ' ' && **in != '\n' && **in != '\t' ) 
 			break;
 			
 		(*in)++;
@@ -78,8 +79,9 @@ static bool _parse_hexint
 	
 		if ( (**in) >= '0' && (**in) <= '9' ) 
 			*result = ((*result) << 4) + (**in) - ((unsigned int) '0');
+		/* Lower-case version is not allowed by RFC 
 		else if ( (**in) >= 'a' && (**in) <= 'f' )
-			*result = ((*result) << 4) + (**in) - ((unsigned int) 'a') + 0x0a;
+			*result = ((*result) << 4) + (**in) - ((unsigned int) 'a') + 0x0a;*/
 		else if ( (**in) >= 'A' && (**in) <= 'F' )
 			*result = ((*result) << 4) + (**in) - ((unsigned int) 'A') + 0x0a;
 		else