From 18ae00f5a4dfd2c5717f42db1a5c09bba2840e0b Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Thu, 22 Jan 2026 17:47:38 -0700 Subject: [PATCH 1/2] fix: passes ISO_8859_1 to BarcodeImageWriterTask constructor instead of null --- .../java/protect/card_locker/BarcodeSelectorAdapter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/protect/card_locker/BarcodeSelectorAdapter.java b/app/src/main/java/protect/card_locker/BarcodeSelectorAdapter.java index 783b82ab2..507fee550 100644 --- a/app/src/main/java/protect/card_locker/BarcodeSelectorAdapter.java +++ b/app/src/main/java/protect/card_locker/BarcodeSelectorAdapter.java @@ -10,6 +10,7 @@ import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import protect.card_locker.async.TaskHandler; @@ -92,13 +93,13 @@ public class BarcodeSelectorAdapter extends ArrayAdapter Log.d(TAG, "Generating barcode for type " + formatType); - BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getContext(), image, cardId, format, null, text, true, null, true, false); + BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getContext(), image, cardId, format, StandardCharsets.ISO_8859_1, text, true, null, true, false); mTasks.executeTask(TaskHandler.TYPE.BARCODE, barcodeWriter); } }); } else { Log.d(TAG, "Generating barcode for type " + formatType); - BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getContext(), image, cardId, format, null, text, true, null, true, false); + BarcodeImageWriterTask barcodeWriter = new BarcodeImageWriterTask(getContext(), image, cardId, format, StandardCharsets.ISO_8859_1, text, true, null, true, false); mTasks.executeTask(TaskHandler.TYPE.BARCODE, barcodeWriter); } } From ce213356b99f91935d8fecc28112569974d7be29 Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Fri, 23 Jan 2026 18:24:17 +0100 Subject: [PATCH 2/2] Add FIXME --- .../main/java/protect/card_locker/BarcodeSelectorAdapter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/protect/card_locker/BarcodeSelectorAdapter.java b/app/src/main/java/protect/card_locker/BarcodeSelectorAdapter.java index 507fee550..4339be12b 100644 --- a/app/src/main/java/protect/card_locker/BarcodeSelectorAdapter.java +++ b/app/src/main/java/protect/card_locker/BarcodeSelectorAdapter.java @@ -75,6 +75,9 @@ public class BarcodeSelectorAdapter extends ArrayAdapter return viewHolder.image.getTag() != null && (boolean) viewHolder.image.getTag(); } + // FIXME: The examples in the selector activity are always rendering using ISO-8859-1, even if UTF-8 is the selected type + // This needs some refactoring to properly retrieve the barcode encoding when rendering an active barcode + // This is the case for example when editing an active card, pressing the "Edit barcode" button, then "More options" and then "Enter the barcode manually" private void createBarcodeOption(final ImageView image, final String formatType, final String cardId, final TextView text) { final CatimaBarcode format = CatimaBarcode.fromName(formatType);