Skip to content

docs: add code comments and improve documentation clarity for string encoding#1463

Closed
Copilot wants to merge 4 commits intodudantas/refactor-string-encoding-to-lib-utf8cppfrom
copilot/sub-pr-1443
Closed

docs: add code comments and improve documentation clarity for string encoding#1463
Copilot wants to merge 4 commits intodudantas/refactor-string-encoding-to-lib-utf8cppfrom
copilot/sub-pr-1443

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 20, 2025

Code review identified missing documentation for control character filtering logic and error handling behavior in the string encoding refactor.

Code Comments

  • Documented control character filtering rationale in utf8_to_latin1 (filters 0x00-0x1F and 0x80-0x9F except tab/CR/LF)
  • Added error handling comments explaining empty string returns on invalid input

API Documentation

  • Updated function signatures in string.h with brief descriptions of error behavior
  • Added "Error Handling Strategy" section to string-encoding-policy.md documenting empty-string-on-error convention
  • Clarified that both ASCII control chars (0x00-0x1F) and C1 control chars (0x80-0x9F) are filtered

Test Coverage

  • Added edge cases: empty strings, NULL bytes, Latin-1 boundaries (0xA0, 0xFF)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

dudantas and others added 2 commits November 15, 2025 07:11
Replaced manual UTF-8 and Latin-1 encoding logic in stdext::string.cpp with utf8cpp for improved correctness and cross-platform consistency. Updated CMake and vcpkg configuration to require utf8cpp. Added documentation on string encoding policy and comprehensive unit tests for encoding/decoding and validation functions.
Copilot AI and others added 2 commits November 20, 2025 03:04
- Added detailed comments explaining control character filtering logic in utf8_to_latin1
- Added error handling comments to all conversion functions
- Updated function documentation in string.h to clarify error behavior
- Enhanced string-encoding-policy.md with error handling strategy and precise character filtering details
- Added additional test cases for edge cases (empty string, NULL bytes, Latin-1 boundaries)

Co-authored-by: dudantas <8551443+dudantas@users.noreply.github.com>
…encoding

Co-authored-by: dudantas <8551443+dudantas@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor string encoding to use utf8cpp and add tests docs: add code comments and improve documentation clarity for string encoding Nov 20, 2025
Copilot AI requested a review from dudantas November 20, 2025 03:06
@sonarqubecloud
Copy link
Copy Markdown

@dudantas dudantas closed this Nov 20, 2025
@dudantas
Copy link
Copy Markdown
Member

Only the unit tests were reusable; the rest is disposable.

@dudantas dudantas deleted the copilot/sub-pr-1443 branch November 20, 2025 03:23
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.

2 participants