From 9567698f631dac64a508b7fd0a1dd20aa60c86a2 Mon Sep 17 00:00:00 2001 From: Sean Owen Date: Sun, 26 Jan 2014 22:47:13 +0000 Subject: [PATCH] Small commit for issue #27, and part of a test --- .../zxing/pdf417/encoder/PDF417HighLevelEncoder.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/google/zxing/pdf417/encoder/PDF417HighLevelEncoder.java b/core/src/main/java/com/google/zxing/pdf417/encoder/PDF417HighLevelEncoder.java index 80e1ab961..991d941f7 100644 --- a/core/src/main/java/com/google/zxing/pdf417/encoder/PDF417HighLevelEncoder.java +++ b/core/src/main/java/com/google/zxing/pdf417/encoder/PDF417HighLevelEncoder.java @@ -23,6 +23,7 @@ package com.google.zxing.pdf417.encoder; import com.google.zxing.WriterException; import java.math.BigInteger; +import java.nio.charset.Charset; import java.util.Arrays; /** @@ -108,6 +109,8 @@ final class PDF417HighLevelEncoder { private static final byte[] MIXED = new byte[128]; private static final byte[] PUNCTUATION = new byte[128]; + static final Charset DEFAULT_ENCODING = Charset.forName("Cp437"); + 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 * * @param msg the message * @return the byte array of the message */ private static byte[] getBytesForMessage(String msg) { - return msg.getBytes(); + return msg.getBytes(DEFAULT_ENCODING); } /**