Skip to content

File.ReadAllText() also detects UTF-16 #7515

Closed
@WelliSolutions

Description

@WelliSolutions

The remarks of File.ReadAlltext() say

Encoding formats UTF-8 and UTF-32 (both big-endian and little-endian) can be detected.

But according to referencesource it uses a StreamReader which supports more encoding detections

It automatically recognizes UTF-8, little-endian Unicode, big-endian Unicode, little-endian UTF-32, and big-endian UTF-32 text if the file starts with the appropriate byte order marks.

Metadata

Metadata

Assignees

Labels

Pri3Indicates issues/PRs that are low priorityarea-System.IOhelp wantedGood for community contributors to help [up-for-grabs]

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions