Skip to content

Instantly share code, notes, and snippets.

@enebo
Last active December 11, 2015 16: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 enebo/4627873 to your computer and use it in GitHub Desktop.
Save enebo/4627873 to your computer and use it in GitHub Desktop.
C:\opt\jruby>.\bin\jruby -J-Dfile.encoding=utf-8 gistfile1.rb
My UTF-8 String: ✓ ®
Original valid utf-8? true
Read #1 valid? false
Read #2 valid? false
Read #3 valid? true
Read #4 valid? true
Read #5 valid? false
Read #6 valid? true
Read #7 valid? true
C:\opt\jruby>\Ruby193\bin\ruby gistfile1.rb
My UTF-8 String: √ r
Original valid utf-8? true
Read #1 valid? false
Read #2 valid? false
Read #3 valid? true
Read #4 valid? true
Read #5 valid? false
Read #6 valid? true
Read #7 valid? true
C:\opt\jruby>.\bin\jruby -Eutf-8 gistfile1.rb
My UTF-8 String: ✓ ®
Original valid utf-8? true
Read #1 valid? true
Read #2 valid? true
Read #3 valid? true
Read #4 valid? true
Read #5 valid? true
Read #6 valid? true
Read #7 valid? true
C:\opt\jruby>\Ruby193\bin\ruby -Eutf-8 gistfile1.rb
My UTF-8 String: √ r
Original valid utf-8? true
Read #1 valid? true
Read #2 valid? true
Read #3 valid? true
Read #4 valid? true
Read #5 valid? true
Read #6 valid? true
Read #7 valid? true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment