How to find Encoding for 1251 codepage

前端 未结 3 931
终归单人心
终归单人心 2021-01-07 17:35

I need to create System.Encoding for 1251 codepage.

On my russian Windows I use

Encoding encoding = Encoding.Default

I am afraid th

3条回答
  •  不思量自难忘°
    2021-01-07 18:10

    Correct, you will get different results on different machines if you use Encoding.Default.

    If you want a specific codepage, you can use Encoding.GetEncoding:

    Encoding encoding = Encoding.GetEncoding("windows-1251");
    

提交回复
热议问题