Skip to content

Instantly share code, notes, and snippets.

Created December 8, 2016 22:07
Show Gist options
  • Save anonymous/8c7d65b7c9dedc7ec9873bb85e3ee1a9 to your computer and use it in GitHub Desktop.
Save anonymous/8c7d65b7c9dedc7ec9873bb85e3ee1a9 to your computer and use it in GitHub Desktop.
jruby-9.1.6.0 :010 > java.lang.System.out.println "ü".to_java_string
ü
=> nil
jruby-9.1.6.0 :011 > java.lang.System.out.println "ü".to_java_bytes
[B@2f9f7dcf
=> nil
jruby-9.1.6.0 :012 > java.lang.System.out.println "ü".to_java_bytes.class
#<Class:0x1bd4fdd>
=> nil
jruby-9.1.6.0 :013 > String.fro
String.from_java_bytes String.frozen?
jruby-9.1.6.0 :013 > java.lang.System.out.println "ü".to_java_bytes.to_s
ü
=> nil
jruby-9.1.6.0 :014 > puts "ü".to_java_bytes.to_s
ü
=> nil
jruby-9.1.6.0 :015 > "ü".to_java_bytes.to_s
=> "\xC3\xBC"
jruby-9.1.6.0 :016 > java.lang.System.out.println "ü".to_java_bytes.to_s
ü
=> nil
jruby-9.1.6.0 :017 > java.lang.System.out.println "ü".to_java_bytes
[B@2a65fe7c
=> nil
jruby-9.1.6.0 :018 > "ü".to_java_bytes.to_s
=> "\xC3\xBC"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment