Merge pull request #8 from ftiercelin/ISS1761

formatting
This commit is contained in:
François Tiercelin 2024-10-22 13:56:04 +01:00 committed by GitHub
commit 434763d029
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -176,11 +176,11 @@ final class PDF417HighLevelEncoder {
}
if (Compaction.TEXT == compaction) {
checkCharset(msg,127,"Consider specifying Compaction.AUTO instead of Compaction.TEXT");
checkCharset(msg, 127, "Consider specifying Compaction.AUTO instead of Compaction.TEXT");
}
if (encoding == null && !autoECI) {
checkCharset(msg,255,"Consider specifying EncodeHintType.PDF417_AUTO_ECI and/or EncodeTypeHint.CHARACTER_SET.");
checkCharset(msg, 255, "Consider specifying EncodeHintType.PDF417_AUTO_ECI and/or EncodeTypeHint.CHARACTER_SET");
}
//the codewords 0..928 are encoded as Unicode characters
@ -290,7 +290,7 @@ final class PDF417HighLevelEncoder {
* @param errorMessage the message to explain the error
* @throws WriterException exception highlighting the offending character and a suggestion to avoid the error
*/
protected static void checkCharset(String input,int max, String errorMessage) throws WriterException {
protected static void checkCharset(String input, int max, String errorMessage) throws WriterException {
for (int i = 0; i < input.length(); i++) {
if (input.charAt(i) > max) {
throw new WriterException("Non-encodable character detected: " + input.charAt(i) + " (Unicode: " +

View file

@ -35,7 +35,9 @@ import org.junit.Test;
* Tests {@link PDF417HighLevelEncoder}.
*/
public final class PDF417EncoderTestCase extends Assert {
private static final String PDF417PFX = "\u039f\u001A\u0385";
@Test
public void testEncodeAuto() throws Exception {
String input = "ABCD";