Skip to content

Instantly share code, notes, and snippets.

@jubilatious1
Last active November 24, 2020 21:28
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 jubilatious1/b99def4cb2d02e6cef5c15b3fd102447 to your computer and use it in GitHub Desktop.
Save jubilatious1/b99def4cb2d02e6cef5c15b3fd102447 to your computer and use it in GitHub Desktop.
##https://stackoverflow.com/q/60365292/7270649
say "â" ~~ /\w/; # you have to have a space following the "a" with "^" for it to work
#「â」
say "�" ~~ /\w/; # without the space, the character doesn't look normal
#Malformed UTF-8 at line 1 col 6
say "â".chars; # looks like 2 chars, but it says 1 char
#1
say "â".comb.[0]; # strange, the pesky char makes the space precede the cursor as I type
say "â".comb.[0 ]; # strange, the pesky char makes the space precede the cursor as I type
say "â".comb.[0]; # there is a space following ']' or it won't work
say "â".comb.[0 ]; # very strange, must have space before ']'
say "â".comb;
#(â)
say "â".comb.[0].ord; # # same here, very strange, it makes space precede the cursor
#226
my $a = Buf.new(226);
#Buf:0x<E2>
say $a.decode('utf8-c8');
#􏿽xE2
for @$a { say $_.chr; };
say (@$a).elems;
#1
say "â" ~~ / <alpha> /; # again, must have space in the quote
#「â」
# alpha => 「â」
say "â" ~~ / <cntrl> /;
#Nil
say "----", "\n";
say $a.decode;
#Malformed termination of UTF-8 string
# in block <unit> at <unknown file> line 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment