Prepare accented characters for HTML

Chris Angelico rosuav at gmail.com
Thu Mar 28 07:02:33 EDT 2019


On Thu, Mar 28, 2019 at 8:58 PM Tony van der Hoff <lists at vanderhoff.org> wrote:
>
> Hi,
>
> I have a MariaDB database, which contains accented (mostly French)
> characters. I need to display these on an HTML page. I'm using the Jinja
> templating engine.
>
> So, for instance, é needs to be replaced by é and so on. I've had
> some success using string.replace(), but it is difficult to cater for
> every case.

Why not just include them as-is? Modern web browsers should have no
trouble at all.

ChrisA



More information about the Python-list mailing list