There is a text saved in database, in the encoded format: for example for German letter
Ü
it stores
Ü
I don't know which method was used to make such a conversion. When executing search, I need to transform character Ü
to Ü
value, how this can be easily done in ROR?
The following doesn't work:
'Ü'.html_safe -> Ü
ERB::Util.html_escape('Ü') -> Ü
Use htmlentities gem.
require 'htmlentities'
HTMLEntities.new.decode('Ü') # => "Ü"
require 'htmlentities'
HTMLEntities.new.encode("Ü", :named) # => "Ü"