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.
249c7fd851c5c5ac5a1abdb756472ae1?d=identicon&s=25 Arup Rakshit (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.