Guest User

Untitled

a guest
May 27th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. .loadlib 'perl6_group'
  2.  
  3. .sub 'main'
  4. # Example string (but do transcode to an encoding explicitly -
  5. # just so happens that it's utf8 by default in Parrot here.)
  6. $S0 = unicode:"öl"
  7.  
  8. # Create byte view.
  9. $P0 = new ['ByteView']
  10. $P0 = $S0
  11.  
  12. # Print the bytes.
  13. $I0 = $P0[0]
  14. say $I0
  15. $I0 = $P0[1]
  16. say $I0
  17. $I0 = $P0[2]
  18. say $I0
  19. .end
Add Comment
Please, Sign In to add comment