Search code examples
htmlcssgoogle-chromeunicodegoogle-chrome-extension

Unicode icons: sometimes looks like a wrong encoding


In my CSS I have this (unrelated code is omitted):

.selector:after {
    content: '▾';
}

Normally it looks like this:

unicode icon ▾

But sometimes I open my browser extension and see this â–¾:

unicode icon broken encoding ▾

In devtools I see the same:

devtools encoding â–¾

Why this happens? How can I fix it?


Solution

  • https://www.w3.org/International/questions/qa-css-charset

    If it's a separate style sheet resource, add @charset "UTF-8"; to the response body and Content-Type: text/css; charset=UTF-8 to the response header.