Replies: 1 comment 5 replies
-
You can't just read from a random segment of a byte stream and get valid output, you have to read from the start. Even ignoring the issue of multi-bute characters, Unicode allows for multi-character sequences, which means finding a valid starting byte isn't sufficient. You'd have to find the start of the entire stream. Why are you reading from the end? Why aren't you reading from the start anyways? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I ask it on stackoverflow a few days before https://stackoverflow.com/questions/73812569/detect-invalid-byte-in-utf8/73813339
when you random read a 1kb byte of a large stream, there no (good) way to detect the start of the valid byte
I'm wonder that is that the
Decoder
orEncoder
of theEncoding
class lack of this capability ?this is the question on stackoverflow
Is this possible in C# ?
What do I need to detect the first valid byte's position?
Beta Was this translation helpful? Give feedback.
All reactions