M
M
MIsternik2017-01-27 15:12:32
.NET
MIsternik, 2017-01-27 15:12:32

What does the encoding of the created strings in C# depend on and how to find out?

There is an application that calls a third-party process (console application).
This console application can output something in Cyrillic and wait for a response.
It outputs in UTF8 .
To give the right answer, you need to understand what the last output of the application.
On the computer I get a string, I compare it with a hardcode and everything is OK, all application lines are in UTF8.
On the server it turns out that the hardcoded string is encoded 1251 , although Encoding.Default == Encoding.UTF8.
How can I figure out what to encode a string from a third-party application into so that it can be compared with a string from the code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2017-01-27
@d-stream

Start -> "cmd" chcp - the actual current console encoding
Most likely it will be 866 ....
but nothing prevents you from doing chcp 1251 chcp 65001 or chcp 20880

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question