Coder Social home page Coder Social logo

Comments (4)

Leont avatar Leont commented on August 21, 2024 3

This is fixed in 0.024

from app-modulebuildtiny.

zakame avatar zakame commented on August 21, 2024

Isolated this down to a double-encode in $dist->get_file, so it is not completely without setting encoding as initially claimed:

https://github.com/Leont/app-modulebuildtiny/blob/74275cf4f9b7260b0c5496dc9ac6c098f6748dc9/lib/App/ModuleBuildTiny.pm#L201-L204

https://github.com/Leont/app-modulebuildtiny/blob/74275cf4f9b7260b0c5496dc9ac6c098f6748dc9/lib/App/ModuleBuildTiny/Dist.pm#L252-L257

  DB<22> x $filename
0  'META.json'
  DB<23> x $dist->{files}{$filename}
0  "{\cJ   \"abstract\" : \"Fast & minimal low-level HTTP client\",\cJ   \"author\" : [\cJ      \"Kang-min Liu <gugod\@gugod.org>\",\cJ      \"Ævar Arnfjörð Bjarmason <avar\@cpan.org>\",\cJ      \"Borislav Nikolov <jack\@sofialondonmoskva.com>\",\cJ      \"Damian Gryski <damian\@gryski.com>\"\cJ   ],\cJ   \"dynamic_config\" : 0,\cJ   \"generated_by\" : \"App::ModuleBuildTiny version 0.023\",\cJ   \"license\" : [\cJ      \"mit\"\cJ   ],\cJ   \"meta-spec\" : {\cJ      \"url\" : \"http://search.cpan.org/perldoc?CPAN::Meta::Spec\",\cJ      \"version\" : 2\cJ   },\cJ   \"name\" : \"Hijk\",\cJ   \"prereqs\" : {\cJ      \"configure\" : {\cJ         \"requires\" : {\cJ            \"Module::Build::Tiny\" : \"0\"\cJ         }\cJ      },\cJ      \"develop\" : {\cJ         \"requires\" : {\cJ            \"App::ModuleBuildTiny\" : \"0.023\"\cJ         }\cJ      },\cJ      \"runtime\" : {\cJ         \"requires\" : {\cJ            \"Time::HiRes\" : \"0\"\cJ         }\cJ      },\cJ      \"test\" : {\cJ         \"requires\" : {\cJ            \"HTTP::Server::Simple::PSGI\" : \"0\",\cJ            \"Net::Ping\" : \"2.41\",\cJ            \"Plack\" : \"0\",\cJ            \"Test::Exception\" : \"0\",\cJ            \"Test::More\" : \"0\"\cJ         }\cJ      }\cJ   },\cJ   \"provides\" : {\cJ      \"Hijk\" : {\cJ         \"file\" : \"lib/Hijk.pm\",\cJ         \"version\" : \"0.27\"\cJ      }\cJ   },\cJ   \"release_status\" : \"stable\",\cJ   \"resources\" : {\cJ      \"repository\" : {\cJ         \"type\" : \"git\",\cJ         \"url\" : \"https://github.com/gugod/Hijk.git\",\cJ         \"web\" : \"https://github.com/gugod/Hijk\"\cJ      }\cJ   },\cJ   \"version\" : \"0.27\",\cJ   \"x_serialization_backend\" : \"JSON::PP version 2.97001\",\cJ   \"x_static_install\" : \"1\"\cJ}\cJ"
  DB<24> x $dist->get_file($filename)
0  "{\cJ   \"abstract\" : \"Fast & minimal low-level HTTP client\",\cJ   \"author\" : [\cJ      \"Kang-min Liu <gugod\@gugod.org>\",\cJ      \"�var Arnfjörð Bjarmason <avar\@cpan.org>\",\cJ      \"Borislav Nikolov <jack\@sofialondonmoskva.com>\",\cJ      \"Damian Gryski <damian\@gryski.com>\"\cJ   ],\cJ   \"dynamic_config\" : 0,\cJ   \"generated_by\" : \"App::ModuleBuildTiny version 0.023\",\cJ   \"license\" : [\cJ      \"mit\"\cJ   ],\cJ   \"meta-spec\" : {\cJ      \"url\" : \"http://search.cpan.org/perldoc?CPAN::Meta::Spec\",\cJ      \"version\" : 2\cJ   },\cJ   \"name\" : \"Hijk\",\cJ   \"prereqs\" : {\cJ      \"configure\" : {\cJ         \"requires\" : {\cJ            \"Module::Build::Tiny\" : \"0\"\cJ         }\cJ      },\cJ      \"develop\" : {\cJ         \"requires\" : {\cJ            \"App::ModuleBuildTiny\" : \"0.023\"\cJ         }\cJ      },\cJ      \"runtime\" : {\cJ         \"requires\" : {\cJ            \"Time::HiRes\" : \"0\"\cJ         }\cJ      },\cJ      \"test\" : {\cJ         \"requires\" : {\cJ            \"HTTP::Server::Simple::PSGI\" : \"0\",\cJ            \"Net::Ping\" : \"2.41\",\cJ            \"Plack\" : \"0\",\cJ            \"Test::Exception\" : \"0\",\cJ            \"Test::More\" : \"0\"\cJ         }\cJ      }\cJ   },\cJ   \"provides\" : {\cJ      \"Hijk\" : {\cJ         \"file\" : \"lib/Hijk.pm\",\cJ         \"version\" : \"0.27\"\cJ      }\cJ   },\cJ   \"release_status\" : \"stable\",\cJ   \"resources\" : {\cJ      \"repository\" : {\cJ         \"type\" : \"git\",\cJ         \"url\" : \"https://github.com/gugod/Hijk.git\",\cJ         \"web\" : \"https://github.com/gugod/Hijk\"\cJ      }\cJ   },\cJ   \"version\" : \"0.27\",\cJ   \"x_serialization_backend\" : \"JSON::PP version 2.97001\",\cJ   \"x_static_install\" : \"1\"\cJ}\cJ"
  DB<25> 

It would seem that correct way would be something along the lines of

if ($dist->is_generated($filename)) {
	open my $fh, '> :raw', $filename or die "Could not generate $filename: $!";
	print $fh Encode::encode 'UTF-8', $dist->{files}{$filename};
}

from app-modulebuildtiny.

patrickbkr avatar patrickbkr commented on August 21, 2024

I use mbtiny v 0.026 and this seems to be broken again.

from app-modulebuildtiny.

Leont avatar Leont commented on August 21, 2024

Apparently it was rather picky about wanting =encoding utf8 instead of =encoding utf-8, which isn't intentional or useful. I'm guessing you ran into that.

I've just release 0.027 which fixes that (and also fixes an encoding issue in README generation)

from app-modulebuildtiny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.