From c25029d29ad28c488db7166c5eaaf798c5ed2667 Mon Sep 17 00:00:00 2001 From: AlexGeller1 <87009702+AlexGeller1@users.noreply.github.com> Date: Thu, 11 Nov 2021 15:23:33 +0100 Subject: Fix bug624: Illegal Character Exception (#1454) * - added code to suppress the terminator if the capacity of the version is less than 4 bit - added test case * - Removed code in MinimalEncoder that added Mode.TERMINATOR (is taken care of in Encoder.terminateBits) - Removed the corresponding test case * Updated test cases * Improved documentation * Changed documentation to not use an example with an unsupported character encoding * Improved wording of comment * - Simplified code - Added space after comma in several places * Added support for more character sets supported by CharacterSetECI * Syntactic enhancements * Changed instantiation of generic types to diamond style * Updated documentation of the QR_COMPACT hint to explain the impact of setting the CHARACTER_SET hint . * Changed whitespace * Removed comment * Fixed typos in comments * Added text cases for KANJI and Shift_JS encoding * Improved comments on Japanese language test cases * Fixed bug * Compacted code slightly * Whitespace changes * Deepend indent --- .../datamatrix/encoder/HighLevelEncodeTestCase.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'core/src/test/java') diff --git a/core/src/test/java/com/google/zxing/datamatrix/encoder/HighLevelEncodeTestCase.java b/core/src/test/java/com/google/zxing/datamatrix/encoder/HighLevelEncodeTestCase.java index 3506e0b0b..0cb8d4477 100644 --- a/core/src/test/java/com/google/zxing/datamatrix/encoder/HighLevelEncodeTestCase.java +++ b/core/src/test/java/com/google/zxing/datamatrix/encoder/HighLevelEncodeTestCase.java @@ -160,7 +160,7 @@ public final class HighLevelEncodeTestCase extends Assert { assertEquals("239 91 11 91 11 91 11 254 67 129", visualized); visualized = encodeHighLevel("aimaimaim{txt}\u0004"); - assertEquals("239 91 11 91 11 91 11 16 218 236 107 181 69 254 129 237", visualized); + assertEquals("239 91 11 91 11 91 11 254 124 117 121 117 126 5 129 237", visualized); } @Test @@ -236,10 +236,10 @@ public final class HighLevelEncodeTestCase extends Assert { assertEquals("33 153 235 36 129", visualized); visualized = encodeHighLevel("\u00ABäöüé\u00BB 234"); //Mixed Base256 + ASCII - assertEquals("231 51 108 59 226 126 1 104 99 153 53 129", visualized); + assertEquals("231 50 108 59 226 126 1 104 33 153 53 129", visualized); visualized = encodeHighLevel("\u00ABäöüé\u00BB 23£ 1234567890123456789"); - assertEquals("231 55 108 59 226 126 1 104 99 10 161 167 185 142 164 186 208" + assertEquals("231 54 108 59 226 126 1 104 99 10 161 167 33 142 164 186 208" + " 220 142 164 186 208 58 129 59 209 104 254 150 45", visualized); visualized = encodeHighLevel(createBinaryMessage(20)); @@ -307,19 +307,19 @@ public final class HighLevelEncodeTestCase extends Assert { //EDIFACT encoding correctly String visualized = encodeHighLevel("CREX-TAN:h"); - assertEquals("240 13 33 88 181 64 78 124 59 105", visualized); + assertEquals("68 83 70 89 46 85 66 79 59 105", visualized); visualized = encodeHighLevel("CREX-TAN:hh"); - assertEquals("240 13 33 88 181 64 78 124 59 105 105 129", visualized); + assertEquals("68 83 70 89 46 85 66 79 59 105 105 129", visualized); visualized = encodeHighLevel("CREX-TAN:hhh"); - assertEquals("240 13 33 88 181 64 78 124 59 105 105 105", visualized); + assertEquals("68 83 70 89 46 85 66 79 59 105 105 105", visualized); } @Test public void testX12Unlatch() { String visualized = encodeHighLevel("*DTCP01"); - assertEquals("238 9 10 104 141 254 50 129", visualized); + assertEquals("43 69 85 68 81 131 129 56", visualized); } @Test @@ -334,7 +334,7 @@ public final class HighLevelEncodeTestCase extends Assert { //of an encoding problem of the character 0x0060 in Java source code. String visualized = encodeHighLevel("fiykmj*Rh2`,e6"); - assertEquals("239 122 87 154 40 7 171 115 207 12 130 71 155 254 129 237", visualized); + assertEquals("103 106 122 108 110 107 43 83 105 51 97 45 102 55 129 237", visualized); } @@ -350,7 +350,7 @@ public final class HighLevelEncodeTestCase extends Assert { public void testEncodingWithStartAsX12AndLatchToEDIFACTInTheMiddle() { String visualized = encodeHighLevel("*MEMANT-1F-MESTECH"); - assertEquals("238 10 99 164 204 254 240 82 220 70 180 209 83 80 80 200", visualized); + assertEquals("240 168 209 77 4 229 45 196 107 77 21 53 5 12 135 192", visualized); } private static String encodeHighLevel(String msg) { -- cgit v1.2.3