Skip to content

fix: BLOB hex encoding + full Unicode width tables#190

Merged
vmvarela merged 1 commit into
masterfrom
fix/v0.15.0-review-fixes
Jul 3, 2026
Merged

fix: BLOB hex encoding + full Unicode width tables#190
vmvarela merged 1 commit into
masterfrom
fix/v0.15.0-review-fixes

Conversation

@vmvarela

@vmvarela vmvarela commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

Two fixes identified during the v0.15.0→master diff review.

BLOB hex encoding in SQL output

The writeSqlRow() else branch called sqlite3_column_text() for BLOB columns, which returns null for non-UTF8 data, causing silent NULL output. Now outputs X'<hex>' format with proper empty-BLOB handling.

Full Unicode width tables

Replaced the minimal 4-range isWideCodepoint() with a comprehensive sorted [2]u21 range table (~80 entries) covering all Unicode East Asian Width W/F ranges plus common emoji. Uses binary search for lookups. All 7 unit tests pass.

Side fixes

  • Fixed 3 incorrect expected values in existing visual.zig tests (were passing incorrect assumptions)
  • Removed redundant superset ranges per code review

- Add BLOB hex encoding (X'...') in SQL INSERT output instead of
  silent NULL conversion (issue in writeSqlRow else branch)
- Handle zero-length BLOB quirk: check column_bytes() before
  column_blob() pointer (null for empty blobs)
- Integration tests for BLOB round-trip (174j) and empty BLOB (174k)

- Replace 4-range isWideCodepoint() with comprehensive sorted
  [2]u21 range table + binary search (~80 ranges)
- Covers CJK A-H, Hiragana/Katakana, Hangul, Yi, Fullwidth,
  Emoji (terminal convention, noted)
- Fix 3 incorrect expected values in existing visual tests
- Add tests for Hiragana, Katakana, and emoji width
@github-actions github-actions Bot added the type:bug Something isn't working label Jul 3, 2026
@vmvarela vmvarela merged commit 10013f7 into master Jul 3, 2026
5 checks passed
@vmvarela vmvarela deleted the fix/v0.15.0-review-fixes branch July 3, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant