I
I
iffkomc2016-01-13 18:13:09
Character encoding
iffkomc, 2016-01-13 18:13:09

How to convert UTF-8 encoding to Windows-1251 (non-standard question)?

Hi friends. I've been working with the web for 3 years now, but I haven't come across this one yet. What is the point:
I have a Cyrillic text with UTF-8 encoding and it is displayed normally.
I need to change the encoding to windows-1251 so that the Cyrillic text is also normally readable. And here's something, well, I can't figure it out at all, how to do it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Eugene, 2016-01-13
@yellowmew

for a large number of files there is a one-liner on powershell:
One catch: encoding default - takes the system encoding.
You can check that this is windows 1251 like this (powershell):
[System.Text.Encoding]::Default.Codepage

B
betal, 2016-01-13
@betal

fi2.php.net/manual/ru/function.iconv.php
Or what programming language?
Or you need a bike for bit-by-bit processing of each character from a double-byte encoding to a single-byte one.

S
Sergey Nalomenko, 2016-01-13
@nalomenko

Do you mean on your own and not in program code? Then with the help of your text editor that you use. For example, if you prefer Sublime Text , then just use the menu item File->Save with encoding > Cyrillic (Windows 1251)

S
Slava Kryvel, 2016-01-13
@kryvel

use iconv, especially if there are
a lot of iconv files for windows
dbaportal.eu/2012/10/24/iconv-for-windows

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question