#8 result.html generates with wrong unicode

오픈
Tarry_Dan1 년 전을 오픈 · 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명
로딩중...
취소
저장
아직 콘텐츠가 없습니다.