This is too generic. It's unclear at what point these characters are remapped or why. The remapping itself can be done in a single gsub: `value.gsub(/#{Regexp.union(...)}/) { |char| MAPPING[char] }`