Created
December 23, 2016 19:45
-
-
Save bjfish/a1f3de2969b7d77c080c44170745c009 to your computer and use it in GitHub Desktop.
Scrub Bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):017:0> "\xD8\x00\x30\x42".force_encoding(Encoding::UTF_16BE).scrub("dog".encode(Encoding::UTF_16BE)) { "cat".encode(Encoding::UTF_16BE) } | |
=> "dog\u3042" | |
irb(main):018:0> "\xD8\x00\x30\x42".scrub("dog") { "cat" } | |
=> "cat\u00000B" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also buggy:
Yielded values might be suspicious