I have a webapp that stores French text -- which potentially includes accented characters -- in a MySQL database. When data is retrieved directly through PHP, accented characters become gibbirish. For instance: qui r?fl?te la liste.
Hence, I use htmlentities()
(or htmlspecialchars()
) to convert the string to html entities, and all is fine. However, when I come to output data that contains both accented characters and HTML elements, things get more complicated. For instance, <strong>
is converted to <strong>
and therefore not understood by the browser.
How can I simultaneously get accented characters displayed correctly and my HTML parsed correctly?
Thank you!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…