Why is Encoding.ASCII! = ASCIIEncoding.Default in C #?

Why is Encoding.ASCII! = ASCIIEncoding.Default in C #?

+2
source share
1 answer

This is because ASCIIEncoding comes from Encoding , where Default is defined as:

 /// <summary> /// Gets an encoding for the operating /// system current ANSI code page. /// </summary> public static System.Text.Encoding Default { get; } 

So ASCIIEndcoding.Default actually returns the default default ANSI encoding for the OS.

+11
source

Source: https://habr.com/ru/post/1400912/


All Articles