how to render special characters properly in ruby on rails? -
i characters ’ … – “ †‘ db. table fetching in latin1 character set. need show these characters properly. how in ruby on rails? there function or piece of code replace these characters correct ones?
you need set encoding of db string. try encode method of string:
dbstr.encode("iso-8859-1") there plenty of other encodings if iso 8859 1 doesn't work you. if users browser doesn't support right encoding, there options can pass encode replace unknowns ?s, etc.
Comments
Post a Comment