Skip to content

Commit 0343532

Browse files
Aurélien Jacobsoberpar
authored andcommitted
geninfo: Fix handling of source path containing non-ASCII characters
Without this fix, genhtml fails on source path that contains non-ASCII characters. [oberpar: Minor commit message changes] Signed-off-by: Aurélien Jacobs <[email protected]>
1 parent 37d117f commit 0343532

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bin/geninfo

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,6 +2174,13 @@ sub read_intermediate_json($$$)
21742174
}
21752175

21762176
for my $file (@{$json->{"files"}}) {
2177+
# decode_json() is decoding UTF-8 strings from the JSON file into
2178+
# Perl's internal encoding, but filenames on the filesystem are
2179+
# usually UTF-8 encoded, so the filename strings need to be
2180+
# converted back to UTF-8 so that they actually match the name
2181+
# on the filesystem.
2182+
utf8::encode($file->{"file"});
2183+
21772184
my $filename = $file->{"file"};
21782185

21792186
$data->{$filename} = $file;

0 commit comments

Comments
 (0)