Skip to content
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

Fix string length detection #3

Merged
merged 1 commit into from
Oct 9, 2022
Merged

Fix string length detection #3

merged 1 commit into from
Oct 9, 2022

Conversation

badcel
Copy link
Owner

@badcel badcel commented Oct 8, 2022

  • Unicode string length detection only checked one byte instead of both
  • UTF32 string length detection only checked one byte instead of all four
  • Added Unit tests to test for special chars which would provoke wrong string length detection

@badcel badcel force-pushed the fix-string-length-detection branch 2 times, most recently from 58e7814 to ca4b252 Compare October 8, 2022 20:01
Copy link
Owner Author

@badcel badcel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

src/HidApi.Net.Tests/StringTests.cs Show resolved Hide resolved
src/HidApi.Net.Tests/StringTests.cs Show resolved Hide resolved
- Unicode string length detection only checked one byte instead of both
- UTF32 string length detection only checked one byte instead of all four
- Added Unit tests to test for special chars which would provoke wrong string length detection
@badcel badcel force-pushed the fix-string-length-detection branch from ca4b252 to 86c0d9f Compare October 9, 2022 10:27
@badcel badcel merged commit 85e3f21 into main Oct 9, 2022
@badcel badcel deleted the fix-string-length-detection branch October 9, 2022 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant