Skip to content

Commit

Permalink
#15 Invalid unicode codepoint warning
Browse files Browse the repository at this point in the history
Fixes for failing tests
  • Loading branch information
pmqs committed Mar 26, 2024
1 parent 79b2eab commit 5b20efa
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bin/zipdetails
Original file line number Diff line number Diff line change
Expand Up @@ -6970,7 +6970,7 @@ sub displayFileInfo
{
# use "utf-8-strict" to catch invalid codepoints
eval { $name = Encode::decode('utf-8-strict', $name, Encode::FB_CROAK ) } ;
::warning $FH->tell() - length $name, "Could not decode 'utf8' $type: " . cleanEval $@
::warning $FH->tell() - length $name, "Could not decode 'UTF-8' $type: " . cleanEval $@
if $@ ;
}
else
Expand Down
2 changes: 1 addition & 1 deletion t/002-main.t
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ sub getUTF8String
$string = $1;
}

# warn "GOTT [$Perl][$]][$string]\n";
# warn "GOT [$Perl][$]][$string]\n";
return $string ;
}

Expand Down
2 changes: 1 addition & 1 deletion t/files/0000-errors/encoding/bad-decode-debug/options
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
--encoding utf8
--encoding utf-8-strict
--output-encoding utf8
--debug-encoding
6 changes: 3 additions & 3 deletions t/files/0000-errors/encoding/bad-decode-debug/stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# DEBUG: Debug Encoding Enabled
# System Default Encoding: 'utf-8-strict'
# Encoding used when reading from zip file: 'utf8'
# Encoding used when reading from zip file: 'utf-8-strict'
# Encoding used for display output: 'utf8'
#

Expand All @@ -18,7 +18,7 @@
001A Filename Length 0003 (3)
001C Extra Length 0000 (0)
#
# WARNING: Offset 0x1E: Could not decode 'utf8' Filename: utf8 "\xE5" does not map to Unicode
# WARNING: Offset 0x1E: Could not decode 'utf-8-strict' Filename: UTF-8 "\xE5" does not map to Unicode
#
001E Filename 'aåa'
#
Expand Down Expand Up @@ -54,7 +54,7 @@
[Bits 28-31] 08 (8) 'Regular File'
0051 Local Header Offset 00000000 (0)
#
# WARNING: Offset 0x55: Could not decode 'utf8' Filename: utf8 "\xE5" does not map to Unicode
# WARNING: Offset 0x55: Could not decode 'utf-8-strict' Filename: UTF-8 "\xE5" does not map to Unicode
#
0055 Filename 'aåa'
#
Expand Down
6 changes: 3 additions & 3 deletions t/files/0000-errors/encoding/bad-decode-debug/stdout-v
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# DEBUG: Debug Encoding Enabled
# System Default Encoding: 'utf-8-strict'
# Encoding used when reading from zip file: 'utf8'
# Encoding used when reading from zip file: 'utf-8-strict'
# Encoding used for display output: 'utf8'
#

Expand All @@ -18,7 +18,7 @@
001A 001B 0002 03 00 Filename Length 0003 (3)
001C 001D 0002 00 00 Extra Length 0000 (0)
#
# WARNING: Offset 0x1E: Could not decode 'utf8' Filename: utf8 "\xE5" does not map to Unicode
# WARNING: Offset 0x1E: Could not decode 'utf-8-strict' Filename: UTF-8 "\xE5" does not map to Unicode
#
001E 0020 0003 61 E5 61 Filename 'aåa'
#
Expand Down Expand Up @@ -55,7 +55,7 @@
[Bits 28-31] 08 (8) 'Regular File'
0051 0054 0004 00 00 00 00 Local Header Offset 00000000 (0)
#
# WARNING: Offset 0x55: Could not decode 'utf8' Filename: utf8 "\xE5" does not map to Unicode
# WARNING: Offset 0x55: Could not decode 'utf-8-strict' Filename: UTF-8 "\xE5" does not map to Unicode
#
0055 0057 0003 61 E5 61 Filename 'aåa'
#
Expand Down
2 changes: 1 addition & 1 deletion t/files/0000-errors/encoding/bad-decode/options
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--encoding utf8
--encoding utf-8-strict
--output-encoding utf8


Expand Down
4 changes: 2 additions & 2 deletions t/files/0000-errors/encoding/bad-decode/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
001A Filename Length 0003 (3)
001C Extra Length 0000 (0)
#
# WARNING: Offset 0x1E: Could not decode 'utf8' Filename: utf8 "\xE5" does not map to Unicode
# WARNING: Offset 0x1E: Could not decode 'utf-8-strict' Filename: UTF-8 "\xE5" does not map to Unicode
#
001E Filename 'aåa'
0021 PAYLOAD KLJN..
Expand Down Expand Up @@ -40,7 +40,7 @@
[Bits 28-31] 08 (8) 'Regular File'
0051 Local Header Offset 00000000 (0)
#
# WARNING: Offset 0x55: Could not decode 'utf8' Filename: utf8 "\xE5" does not map to Unicode
# WARNING: Offset 0x55: Could not decode 'utf-8-strict' Filename: UTF-8 "\xE5" does not map to Unicode
#
0055 Filename 'aåa'

Expand Down
4 changes: 2 additions & 2 deletions t/files/0000-errors/encoding/bad-decode/stdout-v
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
001A 001B 0002 03 00 Filename Length 0003 (3)
001C 001D 0002 00 00 Extra Length 0000 (0)
#
# WARNING: Offset 0x1E: Could not decode 'utf8' Filename: utf8 "\xE5" does not map to Unicode
# WARNING: Offset 0x1E: Could not decode 'utf-8-strict' Filename: UTF-8 "\xE5" does not map to Unicode
#
001E 0020 0003 61 E5 61 Filename 'aåa'
0021 0026 0006 4B 4C 4A 4E PAYLOAD KLJN..
Expand Down Expand Up @@ -41,7 +41,7 @@
[Bits 28-31] 08 (8) 'Regular File'
0051 0054 0004 00 00 00 00 Local Header Offset 00000000 (0)
#
# WARNING: Offset 0x55: Could not decode 'utf8' Filename: utf8 "\xE5" does not map to Unicode
# WARNING: Offset 0x55: Could not decode 'utf-8-strict' Filename: UTF-8 "\xE5" does not map to Unicode
#
0055 0057 0003 61 E5 61 Filename 'aåa'

Expand Down
4 changes: 2 additions & 2 deletions t/files/0000-errors/encoding/efs-and-bad-utf8/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
001A Filename Length 0003 (3)
001C Extra Length 0000 (0)
#
# WARNING: Offset 0x1E: Could not decode 'utf8' Filename: UTF-8 "\xE5" does not map to Unicode
# WARNING: Offset 0x1E: Could not decode 'UTF-8' Filename: UTF-8 "\xE5" does not map to Unicode
#
001E Filename 'aåa'
#
Expand Down Expand Up @@ -56,7 +56,7 @@
[Bits 28-31] 08 (8) 'Regular File'
0051 Local Header Offset 00000000 (0)
#
# WARNING: Offset 0x55: Could not decode 'utf8' Filename: UTF-8 "\xE5" does not map to Unicode
# WARNING: Offset 0x55: Could not decode 'UTF-8' Filename: UTF-8 "\xE5" does not map to Unicode
#
0055 Filename 'aåa'
#
Expand Down
4 changes: 2 additions & 2 deletions t/files/0000-errors/encoding/efs-and-bad-utf8/stdout-v
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
001A 001B 0002 03 00 Filename Length 0003 (3)
001C 001D 0002 00 00 Extra Length 0000 (0)
#
# WARNING: Offset 0x1E: Could not decode 'utf8' Filename: UTF-8 "\xE5" does not map to Unicode
# WARNING: Offset 0x1E: Could not decode 'UTF-8' Filename: UTF-8 "\xE5" does not map to Unicode
#
001E 0020 0003 61 E5 61 Filename 'aåa'
#
Expand Down Expand Up @@ -57,7 +57,7 @@
[Bits 28-31] 08 (8) 'Regular File'
0051 0054 0004 00 00 00 00 Local Header Offset 00000000 (0)
#
# WARNING: Offset 0x55: Could not decode 'utf8' Filename: UTF-8 "\xE5" does not map to Unicode
# WARNING: Offset 0x55: Could not decode 'UTF-8' Filename: UTF-8 "\xE5" does not map to Unicode
#
0055 0057 0003 61 E5 61 Filename 'aåa'
#
Expand Down
4 changes: 2 additions & 2 deletions t/files/0000-errors/encoding/invalid-codepoint/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
001A Filename Length 0001 (1)
001C Extra Length 0000 (0)
#
# WARNING: Offset 0x1E: Could not decode 'utf8' Filename: UTF-8 "\xE5" does not map to Unicode
# WARNING: Offset 0x1E: Could not decode 'UTF-8' Filename: UTF-8 "\xE5" does not map to Unicode
#
001E Filename 'å'
001F PAYLOAD KLJN..
Expand Down Expand Up @@ -42,7 +42,7 @@
[Bits 28-31] 08 (8) 'Regular File'
004F Local Header Offset 00000000 (0)
#
# WARNING: Offset 0x53: Could not decode 'utf8' Filename: UTF-8 "\xE5" does not map to Unicode
# WARNING: Offset 0x53: Could not decode 'UTF-8' Filename: UTF-8 "\xE5" does not map to Unicode
#
0053 Filename 'å'

Expand Down
4 changes: 2 additions & 2 deletions t/files/0000-errors/encoding/invalid-codepoint/stdout-v
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
001A 001B 0002 01 00 Filename Length 0001 (1)
001C 001D 0002 00 00 Extra Length 0000 (0)
#
# WARNING: Offset 0x1E: Could not decode 'utf8' Filename: UTF-8 "\xE5" does not map to Unicode
# WARNING: Offset 0x1E: Could not decode 'UTF-8' Filename: UTF-8 "\xE5" does not map to Unicode
#
001E 001E 0001 E5 Filename 'å'
001F 0024 0006 4B 4C 4A 4E PAYLOAD KLJN..
Expand Down Expand Up @@ -43,7 +43,7 @@
[Bits 28-31] 08 (8) 'Regular File'
004F 0052 0004 00 00 00 00 Local Header Offset 00000000 (0)
#
# WARNING: Offset 0x53: Could not decode 'utf8' Filename: UTF-8 "\xE5" does not map to Unicode
# WARNING: Offset 0x53: Could not decode 'UTF-8' Filename: UTF-8 "\xE5" does not map to Unicode
#
0053 0053 0001 E5 Filename 'å'

Expand Down

0 comments on commit 5b20efa

Please sign in to comment.