V
V
Vadim Rublev2020-01-12 21:17:12
css
Vadim Rublev, 2020-01-12 21:17:12

What is the meaning of character encoding in HTTP header for css/js?

Does it make sense to specify the character encoding in the HTTP header when sending and returning CSS / JS files by the server? After all, everything is in Latin. Or is it better to point it out?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Karpion, 2020-01-12
@Vadim Rublev

JS may well contain non-Latin strings - text for displaying messages.
CSS - I don't know.

V
Vladimir Korotenko, 2020-01-12
@firedragon

JS and CSS
Can contain UTF-8
And you can have a very funny rake in the form of crooked messages.
In general, Americans and other creepy snobs, and you constantly come across these encodings.
General advice if your system allows UTF-8 and this file is not a fragment, save in UTF-8 with BOM
If it is a fragment, then be sure to insert a comment on the first line

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question