-
-
Notifications
You must be signed in to change notification settings - Fork 5
Encode
Taiizor edited this page Mar 1, 2023
·
7 revisions
The Encode
class provides methods to convert text to bytes and bytes to text using various encoding types.
public static byte[] GetBytes(string Text, SEET Encode)
Converts the specified string to an array of bytes using the specified encoding type.
-
Text
: The string to convert to a byte array. -
Encode
: The encoding type to use for the conversion.
The byte array representation of the input string.
-
SE
: If the encoding type is not a defined value in theSEET
enum.
public static string GetString(byte[] Bytes, SEET Encode)
Converts the specified byte array to a string using the specified encoding type.
-
Bytes
: The byte array to convert to a string. -
Encode
: The encoding type to use for the conversion.
The string representation of the input byte array.
-
SE
: If the encoding type is not a defined value in theSEET
enum.
An enumeration of supported encoding types.
public enum EncodeType
{
UTF7,
UTF8,
UTF32,
ASCII,
Unicode,
Default,
BigEndianUnicode
}
Represents an exception that is thrown when an encoding type is not a defined value in the SEET
enum.
A constant string that contains the error message to use when an invalid encoding type is specified.
private static Encoding GetEncoding(this SEET EncodeType, bool UseUtf8IfNotValid = false, string ErrorMessage = ErrorMessage)
Retrieves the Encoding
object for the specified encoding type.
-
EncodeType
: The encoding type to retrieve theEncoding
object for. -
UseUtf8IfNotValid
: A flag indicating whether to use UTF-8 encoding if the specified encoding type is not valid. -
ErrorMessage
: The error message to use if the specified encoding type is not valid.
The Encoding
object for the specified encoding type.
-
SE
: If the encoding type is not a defined value in theSEET
enum andUseUtf8IfNotValid
isfalse
.
- Tax
- Url
- Web
- Ping
- Port
- Text
- Time
- Hash
- Word
- Color
- Speed
- Lottery
- Storage
- Browser
- Unicode
- Password
- JavaScript
- Cryptology
- Typography
- Temperature
- Compression
- Decompression
- Cascading Style Sheets
- JavaScript Object Notation
- Hypertext Markup Language
- Extensible Markup Language
- Extensible HyperText Markup Language