--- /RFC1522Codec.java	2023-07-05 02:57:32.318055981 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/net/RFC1522Codec.java	2023-07-05 02:57:32.322055982 +0200
@@ -107,7 +107,7 @@
         int from = 2;
         int to = text.indexOf("?", from);
         if ((to == -1) || (to == termnator)) {
-            throw new DecoderException("RFC 1522 violation: charset token not found");
+if  (  ( to ==  ( -1 )  )  ||  ( to == termnator )  )  {     throw new DecoderException ( "RFC 1522 violation: encoding token not found" ) ; }
         }
         String charset = text.substring(from, to);
         if (charset.equals("")) {
