From 5fe6a7196acc4172416025f3de383b1dfaa41feb Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 28 Feb 2023 16:52:42 +0200 Subject: [PATCH] use uppercase to encode pdf output descriptor qr --- src/main/java/com/sparrowwallet/sparrow/io/PdfUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/io/PdfUtils.java b/src/main/java/com/sparrowwallet/sparrow/io/PdfUtils.java index 489afc35..67b730be 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/PdfUtils.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/PdfUtils.java @@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory; import java.awt.*; import java.io.*; +import java.util.Locale; import java.util.Scanner; public class PdfUtils { @@ -99,7 +100,7 @@ public class PdfUtils { private static javafx.scene.image.Image getQrCode(String fragment) throws IOException, WriterException { QRCodeWriter qrCodeWriter = new QRCodeWriter(); - BitMatrix qrMatrix = qrCodeWriter.encode(fragment, BarcodeFormat.QR_CODE, QR_WIDTH, QR_HEIGHT); + BitMatrix qrMatrix = qrCodeWriter.encode(fragment.toUpperCase(Locale.ROOT), BarcodeFormat.QR_CODE, QR_WIDTH, QR_HEIGHT); ByteArrayOutputStream baos = new ByteArrayOutputStream(); MatrixToImageWriter.writeToStream(qrMatrix, "PNG", baos, new MatrixToImageConfig());