//encoded line indicates such a non-significant ("soft")
//line break in the encoded text.
if(((strs[i].indexOf("\t") != -1) || (strs[i].indexOf(" ") != -1)) &&
(strs[i].length() > 76))
{
throw new AssertionFailException("The length (" + strs[i].length() +
") of the line (" + (i+1) +
") greater than 76, \"soft\" line breaks must be used");
}
char[] chars = strs[i].toCharArray();
for (int j = 0; j < chars.length; j++)
{
//(1) (General 8bit representation) Any octet, except a CR or
//LF that is part of a CRLF line break of the canonical
//(standard) form of the data being encoded, may be
//represented by an "=" followed by a two digit
//hexadecimal representation of the octet's value. The
//digits of the hexadecimal alphabet, for this purpose,
//are "0123456789ABCDEF". Uppercase letters must be
//used; lowercase letters are not allowed. Thus, for
//example, the decimal value 12 (US-ASCII form feed) can
//be represented by "=0C", and the decimal value 61 (US-
//ASCII EQUAL SIGN) can be represented by "=3D". This
//rule must be followed except when the following rules
//allow an alternative encoding.
// (2) (Literal representation) Octets with decimal values of
//33 through 60 inclusive, and 62 through 126, inclusive,
//MAY be represented as the US-ASCII characters which
//correspond to those octets (EXCLAMATION POINT through
//LESS THAN, and GREATER THAN through TILDE,
//respectively).
if((chars[j] == 61) && (chars.length > j+2))
{
if(!isHex(chars[j+1]) || !isHex(chars[j+2]))
{
throw new AssertionFailException("the quoted char (" +
chars[j] + chars[j+1] + chars[j+2] + ") is incorrect");
} else {
j += 2;
}
}
// check for space and tab
else if((chars[j] != 9) && (chars[j] != 32))
{
// check invalid symbol
if((chars[j] == 0) || (chars[j] == 10) || (chars[j] == 13) ||
(chars[j] < 33) || (chars[j] > 126) || (chars[j] == 61))
{
throw new AssertionFailException("The char (" + chars[j] +
")[code=" + (byte) chars[j] + " position=" + j +
"] must be quoted");
}
}
}