Skip to content

Commit 0aac15c

Browse files
committed
fix unicode issues with mingw/proxspace. Thanks to @nvx for the fix!
1 parent e39a7cd commit 0aac15c

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

client/src/qrcode/qrcode.c

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -899,21 +899,21 @@ void qrcode_print_matrix_utf8_2x2(QRCode *q) {
899899
// UTF-8 block elements for 2x2 pixel blocks
900900
static const char* block_chars[16] = {
901901
" ", // 0000: 0
902-
"", // 0001: 1
903-
"", // 0010: 2
904-
"", // 0011: 3
905-
"", // 0100: 4
906-
"▐", // 0101: 5
907-
"", // 0110: 6
908-
"", // 0111: 7
909-
"", // 1000: 8
910-
"", // 1001: 9
911-
"▌", // 1010: a
912-
"" , // 1011: b
913-
"", // 1100: c
914-
"", // 1101: D
915-
"", // 1110: E
916-
"" // 1111 F
902+
"\xE2\x96\x97", // 0001: 1
903+
"\xE2\x96\x96", // 0010: 2
904+
"\xE2\x96\x84", // 0011: 3
905+
"\xE2\x96\x9D", // 0100: 4
906+
"\xE2\x96\x90", // 0101: 5
907+
"\xE2\x96\x9E", // 0110: 6
908+
"\xE2\x96\x9F", // 0111: 7
909+
"\xE2\x96\x98", // 1000: 8
910+
"\xE2\x96\x9A", // 1001: 9
911+
"\xE2\x96\x8C", // 1010: a
912+
"\xE2\x96\x99" , // 1011: b
913+
"\xE2\x96\x80", // 1100: c
914+
"\xE2\x96\x9C", // 1101: D
915+
"\xE2\x96\x9B", // 1110: E
916+
"\xE2\x96\x88" // 1111: F
917917
};
918918

919919
for (uint8_t y = 0; y < q->size; y += 2) {
@@ -932,8 +932,6 @@ void qrcode_print_matrix_utf8_2x2(QRCode *q) {
932932
}
933933

934934
uint8_t pattern = ((a << 3) | (b << 2) | (c << 1) | d);
935-
//printf("%02x, ", pattern);
936-
937935
PrintAndLogEx(NORMAL, "%s" NOLF, block_chars[pattern]);
938936
}
939937
PrintAndLogEx(NORMAL, "");

0 commit comments

Comments
 (0)