I want to select dropdown having text="Côte d'Ivoire".
ie.select_list(:id, "name01").select("#{text}")
I tried these codes,
1.encoding: UTF-8 #not working
2.text.force_encoding("ASCII-8BIT").encode('UTF-8', undef: :replace, replace:'') #text=Cte d'Ivoire
what should I do for it? I also want to save this text to my DB.Please help.
If you know the string is UTF-8 encoded, why not just force encoding to UTF-8?
If you are using
Côte d'Ivoire
as a literal anywhere in your Ruby source files, be sure to addas the first line of the file to tell Ruby that the file is UTF-8 encoded.