Skip to content
Browse files

Better STDOUT.set_encoding example

  • Loading branch information...
1 parent 28dd9c5 commit aa0e61d6ad99f70a65ad8733e44f7f4e8cc494f9 @candlerb candlerb committed Sep 2, 2009
Showing with 6 additions and 1 deletion.
  1. +6 −1 string19.rb
View
7 string19.rb
@@ -1656,7 +1656,12 @@ def b.to_str
# >> str.encode("UTF-8")
# => "помоник"
#
-# Or: STDOUT.set_encoding "UTF-8"
+# Or you can request transcoding to take place on STDOUT:
+#
+# >> STDOUT.set_encoding "locale"
+# => #<IO:<STDOUT>>
+# >> str
+# => "помоник"
#
# There is some more irb strangeness depending on the string content:
#

0 comments on commit aa0e61d

Please sign in to comment.
Something went wrong with that request. Please try again.