none
Encoding issue? RRS feed

  • Question

  • Hello all,

    I've been having ongoing battles in my html files with specific characters (bullets and dashes) being altered to strange characters sequences eg. dashes changing to a question mark with a black background.

    It happens when I change the first few lines of my html pages from this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />

    to

    <!DOCTYPE html>
    <html>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    Anyone have any ideas how I can solve this?

    Thanks,
    Martin


    Stabes

    Wednesday, April 27, 2016 3:15 PM

All replies

  • The webpage actually needs to be encoded in UTF-8 to work.  Open the webpage in Notepad and do a Save As. Select UTF-8 encoding (bottom of form).
    Wednesday, April 27, 2016 5:43 PM
  • Either re-encode the pages to UTF-8, or leave them alone, and don't tell the browser that they are UTF-8 when they aren't.

    You can try using <meta charset="ISO-8859-1">

    Now, ISO-8859-1 is not identical to windows-1252, but for what is displayed on the web, it's close enough, generally.  Try it and see if your problems go away.



    Kathleen Wilber
    BrightWillow - ASP.NET applications


    • Edited by KathyW2 Wednesday, April 27, 2016 9:21 PM
    Wednesday, April 27, 2016 9:20 PM
  • Thanks all. I think I'll just leave them as they are (there are over 3000 of them :-) ) and just add the viewport meta.

    Martin


    Stabes

    Thursday, April 28, 2016 9:18 AM