Flowdock
method

error_char

Importance_1
Ruby latest stable (v1_9_3_392) - 0 notes - Class: UndefinedConversionError
error_char() public

Returns the one-character string which cause Encoding::UndefinedConversionError.

ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
begin
  ec.convert("\xa0")
rescue Encoding::UndefinedConversionError
  puts $!.error_char.dump   #=> "\xC2\xA0"
  p $!.error_char.encoding  #=> #<Encoding:UTF-8>
end
Show source
Register or log in to add new notes.