C
C
calculator2122021-02-01 09:51:42
go
calculator212, 2021-02-01 09:51:42

How can I determine the default encoding in windows?

The problem arises because I save the report in utf-8 encoding, but some systems use chcp-1251, chcp-861, so I need a way to determine the encoding in the system, can I do it somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-02-01
@calculator212

The standard Windows encoding is written in the registry (I don’t remember what key it is).
But there is no point in this - continue writing in utf-8, and the reader itself must determine that utf-8 is used, or the user himself will indicate this.
For example, in the console, you can select utf-8 using the chcp 65001 command

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question