Improve Hidden Character Finder implementation#300
Draft
Conversation
Owner
|
@copilot retry please |
…e pairs, add HCFService, tests Co-authored-by: AlexHedley <1573469+AlexHedley@users.noreply.github.com>
Author
Done in commit Bug fixes:
Improvements:
Tests: Added 10 tests covering rendering, ASCII char tooltips, multi-byte Unicode, whitespace symbols, hidden chars, and char/byte counts — all 33 project tests pass. |
Copilot
AI
changed the title
[WIP] Port Hidden Character Finder from PHP to C#
Improve Hidden Character Finder implementation
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports and improves the Hidden Character Finder from the PHP reference implementation to C#.
References:
Changes Made
New File:
HCFService.csExtracted all character analysis logic into a public static
HCFServiceclass, making it independently unit-testable without Blazor rendering.Bug Fixes
354instead of160). Now correctly uses(int)c[0]for BMP characters andchar.ConvertToUtf32()for surrogate pairs. <br>\u00A0andU+00A0for multi-byte chars;83<br>0x53for ASCII chars.Text2Htmlnow usesStringInfo.SubstringByTextElementsinstead ofstring.Substring(i, 1)to correctly process characters outside the BMP (emoji, etc.).\uXXXX(4 hex digits) for BMP,\UXXXXXXXX(8 hex digits) for code points > U+FFFF.whiteclass tosymbolclass.Improvements
# characters, # bytesplaceholder with actual computed values displayed after processing.Console.WriteLinecalls, emptyDecode()method, commented-out code, and static example HTML section.Testing
HCFTest.cscovering rendering, ASCII char tooltips, multi-byte Unicode, whitespace symbols, hidden characters, and char/byte counts.Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.