Character Codes

All strings in .NET are stored as 16-bit Unicode characters.


Encoding is the process of transforming a set of Unicode characters into a different character set
Decoding is the process of transforming a different character set into a set of Unicode characters.



System.Text.Ascii



System.Text.ASCIIEncoding



System.Text.Encoding


This encodes a set of characters into a sequence of bytes.

byte[] bytes = System.Text.Encoding.Default.GetBytes(textBefore); 

Remove all the non UTF8 characters from a string.
You can use encoding which is the process of transforming a set of Unicode characters into a sequence of bytes.


string textAfter = System.Text.Encoding.UTF8.GetString(textBefore); 

System.Text.UTF8Encoding





© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext