在我的下拉列表中获取字符

时间:2018-02-20 12:02:26

标签: php html

查看答案PHP Strange character before £ sign?

我试过了两个 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

header('Content-Type: text/html;charset=utf-8');

但如果没有选择任何内容并加载页面,我仍然会在我的下拉列表中获取Â字符。

以下是代码片段。

<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>

以下是Computed

caret样式列表
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);

1 个答案:

答案 0 :(得分:0)

您最有可能在ISO-8859-1中输出内容,然后错误地指定UTF-8。尝试设置文档以显示此字符集:

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

如果问题消失了,那么你肯定知道某些东西没有输出UTF-8;如果你想使用它,请确保你的服务器和数据是UTF-8。