I keep getting an Encoding::UndefinedConversionError - "\\xC2" from ASCII-8BIT to UTF-8 every time I try to convert a hash into a JSON string. I tried
Encoding::UndefinedConversionError - "\\xC2" from ASCII-8BIT to UTF-8
menu.to_s.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')
This worked perfectly, I had to replace some extra characters but there are no more errors.