Skip to content

Instantly share code, notes, and snippets.

@lizmat
Created January 23, 2020 14:24
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 lizmat/fa6f11352210ab96302c7f40c88576a3 to your computer and use it in GitHub Desktop.
Save lizmat/fa6f11352210ab96302c7f40c88576a3 to your computer and use it in GitHub Desktop.
Streaming decoder fail?
my $decoder = Encoding::Registry.find("utf8").decoder;
$decoder.add-bytes(utf8.new(0x0065)); # LATIN SMALL LETTER E
dd $decoder.consume-available-chars;
$decoder.add-bytes(utf8.new(0x0301)); # COMBINING ACUTE ACCENT
dd $decoder.consume-available-chars;
dd $decoder.consume-all-chars;
OUTPUT:
""
"e\x[1]"
""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment