Guest User

Untitled

a guest
Feb 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2. $KCODE = 'U'
  3.  
  4. def encode (text)
  5. text.gsub(/./) do |ch|
  6. sprintf("&#x%02X;", ch.unpack("U")[0])
  7. end
  8. end
  9.  
  10. print encode(STDIN.read)
Add Comment
Please, Sign In to add comment