Normalize broadcast symbols for the Wii font - #3
Merged
Conversation
ColinGamez
marked this pull request as ready for review
July 23, 2026 19:12
Reviewer's GuideNormalize HBNJ program titles/descriptions for Wii-era font limitations by introducing a Wii-safe text sanitizer in collection and enforcing validation that rejects supplementary Unicode characters in the generated guide. Flow diagram for Wii-safe text normalization and validationflowchart LR
subgraph Collection_collect_hbnj_region
A[Raw HBNJ title/description] --> B[compact_text]
B --> C[wii_safe_text]
C -->|empty after wii_safe_text| D[Set title to 番組情報なし]
C -->|non-empty| E[Persist title/description in guide JSON]
end
subgraph Validation_validate_hbnj_guide
E --> F[main]
F --> G[Iterate programs]
G --> H["Scan title for ord(character) > 0xFFFF"]
G --> I["Scan description for ord(character) > 0xFFFF"]
H -->|supplementary found| J[fail with Wii-unsupported codes]
I -->|supplementary found| J
H -->|none| K[Accept title]
I -->|none| L[Accept description]
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider extracting the supplementary-character validation logic in
validate_hbnj_guide.pyinto a small helper (e.g.,assert_wii_safe(field_name, value, program_id)) so the title/description loop is easier to read and can be reused or extended consistently later. - In
wii_safe_text, you currently re-normalize whitespace withre.sub(r"\s+", " ", ...)even thoughcompact_textalready does this; if the function is always called on compacted text, you could skip this second pass to avoid subtly changing inputs that might not have been compacted first.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the supplementary-character validation logic in `validate_hbnj_guide.py` into a small helper (e.g., `assert_wii_safe(field_name, value, program_id)`) so the title/description loop is easier to read and can be reused or extended consistently later.
- In `wii_safe_text`, you currently re-normalize whitespace with `re.sub(r"\s+", " ", ...)` even though `compact_text` already does this; if the function is always called on compacted text, you could skip this second pass to avoid subtly changing inputs that might not have been compacted first.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
What changed
Why
TV no Tomo's Wii-era font renders supplementary Unicode characters as two question-mark boxes. This keeps titles and descriptions readable without changing the native data path.
Checks
Summary by Sourcery
Normalize program titles and descriptions to avoid Wii-unsupported supplementary characters in the HBNJ guide data pipeline.
Bug Fixes:
Enhancements: