Special and accented characters

前端 未结 4 474
情话喂你
情话喂你 2021-01-06 16:05

I am doing some work for a French client and so need to deal with accented characters. But I\'m running into a lot of difficulty, I am hoping the solution is simple and that

4条回答
  •  猫巷女王i
    2021-01-06 16:50

    You need to make sure that the HTML that is sent back to the browser has a charset. You should both send back Content-Type: text/html; charset=UTF-8 as an HTTP response header and include, as the first child element of the head tag:

    
    

    Or, if you are using XHTML:

    
    

    Though just having the meta tag will often fix the problem.

    Also, make sure that your HTML is valid by using the W3C Markup Validation Service.

    See also: FAQ: Weird characters and question marks appear instead of accented characters

提交回复
热议问题