Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created June 2, 2010 23: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 jnthn/423175 to your computer and use it in GitHub Desktop.
Save jnthn/423175 to your computer and use it in GitHub Desktop.
.loadlib 'perl6_group'
.sub 'main'
# Example string (but do transcode to an encoding explicitly -
# just so happens that it's utf8 by default in Parrot here.)
$S0 = unicode:"öl"
# Create byte view.
$P0 = new ['ByteView']
$P0 = $S0
# Print the bytes.
$I0 = $P0[0]
say $I0
$I0 = $P0[1]
say $I0
$I0 = $P0[2]
say $I0
.end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment