Small commit for issue #27, and part of a test

This commit is contained in:
Sean Owen 2014-01-26 22:47:13 +00:00
parent 077ae83bc3
commit 9567698f63

View file

@ -23,6 +23,7 @@ package com.google.zxing.pdf417.encoder;
import com.google.zxing.WriterException; import com.google.zxing.WriterException;
import java.math.BigInteger; import java.math.BigInteger;
import java.nio.charset.Charset;
import java.util.Arrays; import java.util.Arrays;
/** /**
@ -108,6 +109,8 @@ final class PDF417HighLevelEncoder {
private static final byte[] MIXED = new byte[128]; private static final byte[] MIXED = new byte[128];
private static final byte[] PUNCTUATION = new byte[128]; private static final byte[] PUNCTUATION = new byte[128];
static final Charset DEFAULT_ENCODING = Charset.forName("Cp437");
private PDF417HighLevelEncoder() { private PDF417HighLevelEncoder() {
} }
@ -130,14 +133,14 @@ final class PDF417HighLevelEncoder {
} }
/** /**
* Converts the message to a byte array using the default encoding (cp437) as defined by the * Converts the message to a byte array using the default encoding (Cp437) as defined by the
* specification * specification
* *
* @param msg the message * @param msg the message
* @return the byte array of the message * @return the byte array of the message
*/ */
private static byte[] getBytesForMessage(String msg) { private static byte[] getBytesForMessage(String msg) {
return msg.getBytes(); return msg.getBytes(DEFAULT_ENCODING);
} }
/** /**