Gsub With unicode characters

Hi

I am writing a RoR application that needs to work with a database full
of french unicode characters, unfortunately whenever I try to display a
field with those values in a show I just get a question mark or no
character displayed.

So I decided to run a gsub (there’s only 2 fields with this problem) on
the field before displying it to replace the characters with their HTML
equivalents, for example:
french_name.gsub!(/é/, ‘é’)

However this does not appear to work, I’ve tried a few different methods
for the regex after some googling but nothing seems to be doing the
trick…

If anyone has any ideas I’d appreciate your help!

Thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs