Appearance
GetFileEncoding Method
Definition
- Namespace:
JASE.IO - Assembly:
JASE.dll
Overloads
| Name | Description |
|---|---|
Encoding GetFileEncoding(Stream stream) | Attempts to detect the text encoding of a file from a stream by inspecting its initial bytes. |
Encoding GetFileEncoding(string filename) | Attempts to detect the text encoding of the specified file. |
Encoding GetFileEncoding(Stream stream)
csharp
Encoding GetFileEncoding(Stream stream)Attempts to detect the text encoding of a file from a stream by inspecting its initial bytes.
Parameters
| Name | Description |
|---|---|
stream | The stream to examine. The current position is preserved. |
Returns
The detected encoding, or a default encoding if the encoding cannot be determined.
Encoding GetFileEncoding(string filename)
csharp
Encoding GetFileEncoding(string filename)Attempts to detect the text encoding of the specified file.
Parameters
| Name | Description |
|---|---|
filename | The path to the file to examine. |
Returns
The detected encoding, or a default encoding if the encoding cannot be determined.