encoder test pass

This commit is contained in:
Henry
2022-09-26 20:49:25 -05:00
parent f203325b6d
commit a228f6300a
4 changed files with 26 additions and 79 deletions

View File

@@ -278,22 +278,7 @@ impl HighLevelEncoder {
b':' if next_char == b' ' => 5,
_ => 0,
};
// switch (text[index]) {
// case '\r':
// pairCode = nextChar == '\n' ? 2 : 0;
// break;
// case '.' :
// pairCode = nextChar == ' ' ? 3 : 0;
// break;
// case ',' :
// pairCode = nextChar == ' ' ? 4 : 0;
// break;
// case ':' :
// pairCode = nextChar == ' ' ? 5 : 0;
// break;
// default:
// pairCode = 0;
// }
if pair_code > 0 {
// We have one of the four special PUNCT pairs. Treat them specially.
// Get a new set of states for the two new characters.

View File

@@ -87,7 +87,6 @@ impl State {
let eci_digits = encoding::all::ISO_8859_1
.encode(&format!("{}", eci), encoding::EncoderTrap::Strict)
.unwrap();
dbg!(format!("{}", eci));
// let eciDigits = Integer.toString(eci).getBytes(StandardCharsets.ISO_8859_1);
token.add(eci_digits.len() as i32, 3); // 1-6: number of ECI digits
for eci_digit in &eci_digits {