GithubHelp home page GithubHelp logo

Comments (6)

andreamah avatar andreamah commented on June 15, 2024

image

I'm not sure if I'm reproducing this correctly. I tried using the ISO-8859-1 charset for the file and as a head tag, but I'm seeing the symbol in live preview. Can you paste your code?

from vscode-livepreview.

mortensp avatar mortensp commented on June 15, 2024

Hi.

I have insolated the problem and made a small demo. It all comes down to the load() method. In the demo I have one div tag in the (main) demo.html and the same in "include.html", which is loaded below the first. My demo fails to display the loaded text correct, but it displays fine when run in Chrome. If I out-comment line 19 it's just the opposite.
I have include the project as a zip file!
LivePreviewDemo.zip

Include.html:
image

demo.,html:
image

from vscode-livepreview.

andreamah avatar andreamah commented on June 15, 2024

Hmm, I noticed that if I set the encoding in the editor, it displays correctly. Have you tried this out?
image

from vscode-livepreview.

mortensp avatar mortensp commented on June 15, 2024

I always have charset ISO-8859-1 in the VS Code editor as you can se below. And I notice, that it doesn't display correct in your screen dump either! Here is my screen dump with the same page shown in Chrome (after hitting F5) on the right side.

image

I just noted that there is a difference in the "letters" displayed:
with line 19 active: ������
without line 19: ������

Could it be some kind of double conversion - from UTF-8 to iso 8859-1 and then again from what is supposed to be UTF-8 to iso 8859-1?

ps. When I first started coding, VS code was set to UTF-8 as standard and I typed in some danish letters which looked fine until I ran the html page. The I changed the charset in the editor which made it all unreadable. So I had to retype the special characters. Could I be that your VS code was opened with UTF-8 on my code?

from vscode-livepreview.

andreamah avatar andreamah commented on June 15, 2024

I have a feeling that it might be an issue with how I host the content

<meta http-equiv="Content-type" content="text/html;charset=UTF-8">

I will need to experiment with this to see whether it's the cause or whether there's a better way to set this.

from vscode-livepreview.

leonbloy avatar leonbloy commented on June 15, 2024

I've noticed something similar.

If I save a testlatin.html webpage with Latin1 (ISO-8859-1) charset encoding, then when I get it via the server
curl -v http://127.0.0.1:3000/testlatin.html | od -t x1z
I get it in UTF-8.
Not only the http header says Content-Type: text/html; charset=UTF-8 , but the content itself appears to have been converted to UTF-8. The meta tag <meta charset="ISO-8859-1" /> has no effect.
I dont't know who is doing the conversion, but it seems confusing.

from vscode-livepreview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.