Forum: Ruby string#encode with fallback not working

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5627b1da66c6ce007b5b5409dd2ed364?d=identicon&s=25 Arup R. (my-ruby)
on 2013-11-11 22:00

I am trying to replace '?' with 'e',but no luck

s = "V\345ctor"
s.encode!('ASCII',:invalid => :replace) # => "V?ctor"
s.encode(:fallback => {'?' => 'e'}) # => "V?ctor"

any help please?
This topic is locked and can not be replied to.