3.1.1.2.2.4.7 Octet Comparison Rule

Two values are equal when they are the same length and have identical contents. A value S1 is less than a value S2, where L is the smaller of the length of S1 and the length of S2, if either the first L bytes of S1 are less than the first L bytes of S2, or if the first L bytes of S1 and S2 are identical but the length of S1 is less than the length of S2. Given L = 1, S1 is less than S2 if the value of the first byte of S1 is less than the value of the first byte of S2. Given L > 1, for the first L bytes of S1 to be less than the first L bytes of S2 means that there exists an N (where N<L) such that bytes 0...N-1 of S1 and S2 are identical, and byte N of S1 is less than byte N of S2.

For substring purposes, each byte in the value is treated as if it was a character. Values are compared using the ordinary rules for a SubstringFilter, as defined in [RFC2251] section 4.5.1. The "characters" are treated as if they were case-sensitive; that is, two characters are considered identical if and only if the bytes that represent them are identical.