Lenty / SLiCAP_python

Open-source version of SLiCAP, implemented in python
Other
33 stars 15 forks source link

A problem with charset iso-8859-1 #30

Closed Airstrike25 closed 2 years ago

Airstrike25 commented 3 years ago

While making the assignment we found that there is a difference between what your browser renders on Windows or Ubuntu. The HTML code generated by SLiCAP is as follows:

<a id=""></a><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<title>"Requirements"</title><link rel="stylesheet" href="css/slicap.css">
<script>MathJax = {tex:{tags: 'ams', inlineMath:[['$','$'],]}, svg:{fontCache:'global'}};</script>
<script type="text/javascript" id="MathJax-script" async  src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
</head><body><div id="top"></div>
<p>- Temperature range -25°C to +70°C</p>
<!-- INSERT -->
<div id="footnote">

</div></body></html>

With this code, the browser renders the °C different. On Ubuntu 20.04 with Firefox 85.0.1 (64-bit), it renders as °C On Windows, this works fine.

A fix could be to change the charset from iso-8859-1 to UTF-8. (SLiCAPhtml.py line 86) Unless there is a deeper problem with changing the charset that I do not know :smiley:

antonmontagne commented 2 years ago

Thank you for your comment. I tested your solution and see no issues. It will be implemented in version 1.0.1.