-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add detect encoding with BOM: UTF-7 and GB-18030 #98
Add detect encoding with BOM: UTF-7 and GB-18030 #98
Conversation
because len <= buf.Length always
So in the end it is called from the following places UTF-unknown/src/CharsetDetector.cs Line 142 in cb3dca2
UTF-unknown/src/CharsetDetector.cs Lines 199 to 201 in cb3dca2
via UTF-unknown/src/CharsetDetector.cs Line 269 in cb3dca2
UTF-unknown/src/CharsetDetector.cs Line 283 in cb3dca2
UTF-unknown/src/CharsetDetector.cs Lines 297 to 299 in cb3dca2
|
It's bug or feature? |
At least add verification will be more efficient |
It seemed like it would be better, because otherwise, you need to add a length check every time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks!
[TestCase(new byte[] { 0x2B, 0x2F, 0x76, 0x39 })] | ||
[TestCase(new byte[] { 0x2B, 0x2F, 0x76, 0x2B })] | ||
[TestCase(new byte[] { 0x2B, 0x2F, 0x76, 0x2F })] | ||
[TestCase(new byte[] { 0x2B, 0x2F, 0x76, 0x38, 0x2D })] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
Thanks for the refactor also :) |
Resolve #79
Add detect