Ticket #1556: utf8-bom.patch

File utf8-bom.patch, 940 bytes (added by retrosnub, 12 years ago)
  • source/tools/entity/checkrefs.pl

    diff --git a/source/tools/entity/checkrefs.pl b/source/tools/entity/checkrefs.pl
    index aba2a50..026020f 100755
    a b sub add_civs  
    372372        push @roots, $f;
    373373
    374374        open my $fh, vfs_to_physical($f) or die "Failed to open '$f': $!";
    375         my $civ = decode_json(do { local $/; <$fh> });
     375        my $civ = decode_json(do { local $/; my $file = <$fh>; $file =~ s/^\xEF\xBB\xBF//; $file });
    376376
    377377        push @deps, [ $f, "art/textures/ui/" . $civ->{Emblem} ];
    378378
    sub add_rms  
    394394        push @roots, $f;
    395395
    396396        open my $fh, vfs_to_physical($f) or die "Failed to open '$f': $!";
    397         my $rms = decode_json(do { local $/; <$fh> });
     397        my $rms = decode_json(do { local $/; my $file = <$fh>; $file =~ s/^\xEF\xBB\xBF//; $file });
    398398
    399399        push @deps, [ $f, "maps/random/" . $rms->{settings}{Script} ];
    400400