I am migrating an app from php to rails, and am facing some issues in the display of em-dash. I am displaying a field which according to phpmyadmin and rails console, has the value of "Mon,Tue & Thu: 8 a.m. – 12 a.m." where the – is supposed to be an em-dash (the long dash). Not sure why it is stored this way to begin with..
In php I display with <td><b>Opening Hours</b><br><?= nl2br($bar['opening_hours']) ?></td>
and this renders to Mon,Tue & Thu: 8 a.m. – 12 a.m.
In rails I display this with = simple_format(@venue.opening_hours, style: "margin-bottom: 0px;")
in slim. This however just renders to Mon,Tue & Thu: 8 a.m. – 12 a.m.
Does anyone have any idea why this happens to begin with and how come php overcomes it? I tried echo nl2br("Mon,Tue & Thu: 8 a.m. – 12 a.m.");
on http://phpepl.cloudcontrolled.com/ and it just printed it as is..
edit: outputing to error_log
gets me Mon,Tue & Thu: 8 a.m. \xe2\x80\x93 12 a.m.