Skip to content

Instantly share code, notes, and snippets.

@cowens
Created March 16, 2017 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cowens/1f72cffb2ec17d50fe923b74e38e6283 to your computer and use it in GitHub Desktop.
Save cowens/1f72cffb2ec17d50fe923b74e38e6283 to your computer and use it in GitHub Desktop.
(Str)
4
e􏿽xCC􏿽x81
#!/usr/bin/env perl6
use v6;
my $out = open "test.txt", :w, :bin;
my $buf = Buf.new(0x65, 0xcc, 0x81, 0x0a);
$out.write: $buf;
my $in = open "test.txt", :enc<utf8-c8>;
my $s = $in.slurp-rest;
$s.WHAT.say;
$s.chars.say;
$s.say;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment