1

Looking at answer PHP Strange character before £ sign?

I have tried both the
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
and
header('Content-Type: text/html;charset=utf-8');

but I stil get the  char in my dropdown if nothing was selected and the page loads.

Here is a snip of the code.

<div class='dropdown'>
  <button class='btn btn-default dropdown-toggle col-sm-12'  type='button' id='dropdownMenu1' data-toggle='dropdown' aria-haspopup='true' aria-expanded='true'>
    <span data-type='help' class='dropdown_text' id=''></span>
    <span class='caret'></span>
  </button>
  <ul class='dropdown-menu' aria-labelledby='dropdownMenu1'>
    <li><a href='#' class='list-item'>Yes</a></li>
    <li><a href='#' class='list-item'>No</a></li>
    <li><a href='#' class='list-item'></a></li>
  </ul>
</div>

Here is a list of the Computed styles for the caretclass

border-left-color: rgba(0, 0, 0, 0);
border-left-style: solid;
border-left-width: 4px;
border-right-color:rgba(0, 0, 0, 0);
border-right-style:solid;
border-right-width:4px;
border-top-color:rgb(51, 51, 51);
border-top-style:dashed;
border-top-width: 4px;
box-sizing:border-box;
color:rgb(51, 51, 51);
cursor:pointer;
display: inline-block ;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size:14px;
font-stretch:100% ;
font-style:normal;
font-variant-caps: normal;
font-variant-east-asian: normal;
font-variant-ligatures:normal;
font-variant-numeric: normal;
font-weight:400 ;
height:4px;
letter-spacing: normal;
line-height:20px;
list-style-image: none;
list-style-position: outside;
list-style-type:none;
margin-left: 0px;
text-align:center;
text-indent:0px;
text-rendering:auto;
text-shadow:none ;
text-size-adjust:100%;
text-transform: none;
user-select:none ;
vertical-align:middle;
white-space: nowrap;
width:8px;
word-spacing: 0px;
writing-mode:horizontal-tb ;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
morne
  • 4,035
  • 9
  • 50
  • 96
  • What is the CSS for –  Feb 20 '18 at 12:04
  • 2
    Are you sure that your code/html is really encoded in `utf-8` ? Specifying `utf-8` in headers is just declarative but it does not make your code encoded in `utf-8`. – ADreNaLiNe-DJ Feb 20 '18 at 12:22
  • *Everything* needs to be UTF-8. You've specified that you've set it as the encoding for the page as rendered in the browser, but it needs to be the same encoding all the way down through your system. Your database must have the right encoding. Even the php code files need to be saved with UTF-8 encoding. – Simba Feb 20 '18 at 12:37

1 Answers1

0

You are most likely outputting something in ISO-8859-1 and then incorrectly specifying UTF-8. Try instead setting the document to display this charset:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

If the problem is gone, then you'll know for sure something is not outputting UTF-8; make sure your server and the data is in UTF-8 if you want to use it.

dukevin
  • 22,384
  • 36
  • 82
  • 111
  • Thanks, but the problem remains. – morne Feb 20 '18 at 13:01
  • Use an application to see what the encoding of your files are and verify that they are UTF-8. Are you generating this code programmatically or is this a static html file? – dukevin Feb 20 '18 at 13:03