Today I saw a code in which UTF8Encoding.UTF8.GetBytes
and Encoding.UTF8.GetBytes
is used. Is there any difference between them?
No difference at all.
Encoding.UTF8
is UTF8Encoding
.
From MSDN (Encoding.UTF8
):
This property returns a UTF8Encoding object
Instead of Encoding.UTF8.GetBytes
you can simply call UTF8Encoding.GetBytes
.