V
V
viktorross2019-03-28 13:54:51
Character encoding
viktorross, 2019-03-28 13:54:51

Why isn't the encoding correct everywhere?

Hello, why is the text not displayed everywhere in the correct encoding when uploading a link to social networks?
problem with Russian characters
on the site installed
<meta charset="utf-8">no problems with encoding on the site, everything is displayed normally

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hint000, 2019-03-29
@hint000

This is the browser itself "hooligan", normalizes the URL.
https://ru.wikipedia.org/wiki/Internationalized_Re...
https://ru.wikipedia.org/wiki/URL#URL_Encoding
https://ru.wikipedia.org/wiki/URL_Normalization
Don't know if there is any -something is the right way (some setting in the browser), but I solve it for myself in a crutch way. If you select not the entire link, but part of it, then it is copied normally. It is enough not to select the first letter, like this: ttps://site... After inserting this letter, you can add it manually. Without the first letter, the browser does not recognize this as a valid URL, so it does not recode anything, it leaves it as it is, i.e. as we needed.
I note that this is not some kind of mistake, in principle, the browser wants "what is best for everyone." Imagine that someone in China, in India or in the USA wants to open such a link. Not the fact that the link with Russian letters will open correctly in the browser, because. Russian letters could be at some stage really incorrectly recoded. But a link in this encoding - %D0%9F%D0%B5 - is universal, it looks the same in any country, and will open everywhere. But when the site is completely Russian-speaking and this universality is not needed, then you have to use crutches :)

V
Vapaamies, 2019-03-31
@vapaamies

https://site/25490-%D0%9F%D0%B5%D1%81%D0%BA%D0%BE%D1%81%D1%82%D1%80%D1%83%D0%B9%D0%BD%D0%B0%D1%8F-%D0%BE%D1%87%D0%B8%D1%81%D1%82%D0%BA%D0%B0-%D1%80%D0%B0%D0%BC%D1%8B-%D0%BE%D1%82-%D0%B2%D0%BD%D0%B5%D0%B4%D0%BE%D1%80%D0%BE%D0%B6%D0%BD%D0%B8%D0%BA%D0%B0-%D0%B4%D0%B6%D0%B8%D0%BF/details.html

This link is correct. IE 4 also knew how to encode international links in UTF-8. This has nothing to do with page content encoding.
The problem is not in the browser, but in the server. The web server must correctly interpret incoming links in UTF-8 and re-encode them to the file system encoding (or whatever you have, if not files), if it differs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question