Created
March 29, 2010 19:04
-
-
Save norman/348261 to your computer and use it in GitHub Desktop.
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 | |
ruby-1.9.1-p378 > string = "Jürgen Müller" | |
=> "Jürgen Müller" | |
ruby-1.9.1-p378 > string.force_encoding("BINARY").encode("UTF-8", :invalid => :replace, :replace => "") | |
Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8 | |
from (irb):2:in `encode' | |
from (irb):2 | |
from /Users/norman/.rvm/rubies/ruby-1.9.1-p378/bin/irb:17:in `<main>' | |
ruby-1.9.1-p378 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment