A
A
AndersDir2022-02-06 15:02:34
git
AndersDir, 2022-02-06 15:02:34

Empty text in git and broken encoding in files, how to fix it?

Hey guys!

I am working on a project. Old, from the pre-Covid era, on Bitrix. He has a weird encoding.
In the git, where the text is empty, only punctuation marks and numbers:
61ffb7965bf29141518649.png

In the files it’s like this:
61ffb7bf74ac5685802803.png

At the same time, the site itself displays ok, but as soon as I upload, let’s say, new text, it immediately turns into heresy:
61ffb7f4f2111449945858.png

I even set it in htaccess AddDefaultCharset UTF-8. Files in UTF8 without BOM. Nothing helps.
The only working way is to edit the texts directly through the admin panel on the production site. That's how it works.

I want to work normally with the site, making changes to the repository and not getting a broken encoding at the output. Can anyone come across?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-02-06
@AndersDir

The encoding of the files themselves is probably CP1251, and you edit the files using UTF-8, hence the problems.
Set up the CP1251 encoding in a text editor.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question