Prepare accented characters for HTML

Tony van der Hoff lists at vanderhoff.org
Thu Mar 28 07:53:50 EDT 2019


On 28/03/2019 11:02, Chris Angelico wrote:
> 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
> 
Thanks, Chris. The problem is not with the browser, but Jinja crashes.
Probably a bug, but I'm too wedded to that engine to change now. I'll
raise it on the Jinja bug site.



-- 
Tony van der Hoff        | mailto:tony at vanderhoff.org
Buckinghamshire, England |



More information about the Python-list mailing list