Skip to content

Instantly share code, notes, and snippets.

@nathanharper
Created February 10, 2014 19:44
Show Gist options
  • Save nathanharper/8922797 to your computer and use it in GitHub Desktop.
Save nathanharper/8922797 to your computer and use it in GitHub Desktop.
Convert STDIN to equivalent output in Unicode code points. If the input was a Scala program, you can run the output! YAY!
for (ln <- io.Source.stdin.getLines)
println(ln map {c => "\\u%04X".format(c.toInt)} mkString)
@nathanharper
Copy link
Author

OMG the Unicode version AHAHAHA I'M SO CLEVER

\u0066\u006F\u0072\u0020\u0028\u006C\u006E\u0020\u003C\u002D\u0020\u0069\u006F\u002E\u0053\u006F\u0075\u0072\u0063\u0065\u002E\u0073\u0074\u0064\u0069\u006E\u002E\u0067\u0065\u0074\u004C\u0069\u006E\u0065\u0073\u0029
\u0020\u0020\u0070\u0072\u0069\u006E\u0074\u006C\u006E\u0028\u006C\u006E\u0020\u006D\u0061\u0070\u0020\u007B\u0063\u0020\u003D\u003E\u0020\u0022\u005C\u005C\u0075\u0025\u0030\u0034\u0058\u0022\u002E\u0066\u006F\u0072\u006D\u0061\u0074\u0028\u0063\u002E\u0074\u006F\u0049\u006E\u0074\u0029\u007D\u0020\u006D\u006B\u0053\u0074\u0072\u0069\u006E\u0067\u0029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment