#8 result.html generates with wrong unicode

Отворено
отворено пре 1 година од Tarry_Dan · 1 коментара
Tarry_Dan коментирира пре 1 година

Error:

  1. I run the code. It generates result.html (and iirc, the first time...it displays with the stylesheet)

  2. I run it again. The website is now not displaying any styles. Looking at View Source, I can click the link to the stylesheet and correctly open it. The path is correct. But they don't display. The inspect tool shows no styles present.

  3. If I copy the html from results.html into a new file, and open that - the page displays correctly. As it should: the css is correct, and so is the link in the html.

  4. But for some reason, no future version of results.html shows styles.

  5. When I open results.html in notepad, and save it - it automatically gives the option to save the encoding as 'Unicode', presumably because that's what it detects. When I change that to 'UTF-8', the problem is now solved. Opening results.html in the browser displays my custom css.

I am using Windows PowerShell to run my code - I'm unsure if it's a PowerShell behavior I need to fix, or if there's something at your end you can set to ensure it always exports the results.html file in UTF-8 correctly.

Cheers!

Error: 1. I run the code. It generates result.html (and iirc, the first time...it displays with the stylesheet) 2. I run it again. The website is now not displaying any styles. Looking at View Source, I can click the link to the stylesheet and correctly open it. The path is correct. But they don't display. The inspect tool shows no styles present. 3. If I copy the html from results.html into a new file, and open that - the page displays correctly. As it should: the css is correct, and so is the link in the html. 4. But for some reason, no future version of results.html shows styles. 5. When I open results.html in notepad, and save it - it automatically gives the option to save the encoding as 'Unicode', presumably because that's what it detects. When I change that to 'UTF-8', the problem is now solved. Opening results.html in the browser displays my custom css. I am using Windows PowerShell to run my code - I'm unsure if it's a PowerShell behavior I need to fix, or if there's something at your end you can set to ensure it always exports the results.html file in UTF-8 correctly. Cheers!
likho коментирира пре 1 година
Власник

Hi. Thanks for the feedback.

I run the script and therefore the python interpreter on Linux. My python install and terminal emulator are generic. The example Makefile is also pretty close to how I run the script.

The only logic relating to unicode is recognizing blank character in content.txt if the user wants to break a tag e.g #fanfic|tion. But this shouldn't be the cause.

My first guesses are

  1. Windows handling line breaks differently from Linux.

  2. the application you are using to preview the result is caching the page

  3. you have two result.html, but one of which is updated by the script while the other is not

If 3 is the case, you could add a line to your .sh, .bat, or Makefile to e.g cp pc/result.html webserver/result.html

Hi. Thanks for the feedback. I run the script and therefore the python interpreter on Linux. My python install and terminal emulator are generic. The example Makefile is also pretty close to how I run the script. The only logic relating to unicode is recognizing blank character in content.txt if the user wants to break a tag e.g #fanfic|tion. But this shouldn't be the cause. My first guesses are 1. Windows handling line breaks differently from Linux. 2. the application you are using to preview the result is caching the page 3. you have two result.html, but one of which is updated by the script while the other is not If 3 is the case, you could add a line to your .sh, .bat, or Makefile to e.g `cp pc/result.html webserver/result.html`
Пријавите се да се прикључе у овом разговору.
Нема лабеле
Нема фазе
Нема одговорних
2 учесника
Учитавање...
Откажи
Сачувај
Још нема садржаја.