Skip to content

Cathet v4.0.3

Choose a tag to compare

@Crlyzd Crlyzd released this 10 Oct 22:27
· 34 commits to master since this release

Cathet v4.0.3 Release Notes

Release Version: v4.0.3
Previous Release: v4.0.2
Target Platform: Windows 10 & Windows 11 (x64 / ARM64)
Git Tag: v4.0.3
Commit Range: v4.0.2..HEAD (2 commits)


⚡ Highlights of v4.0.3

Cathet v4.0.3 introduces a Universal Text Decoder to ensure Cathet can open text and markdown documents created by any Windows application or camera/device workflow. Previously, opening files encoded in UTF-16 LE (such as DJI drone metadata logs, MediaInfo reports, or PowerShell output redirects) triggered an "unsupported encoding" modal. With v4.0.3, Cathet automatically inspects file headers and transcode byte streams transparently into clean Unicode with zero external dependencies and zero binary bloat.


🌟 What's New & Improved

📄 Universal Text & Encoding Pipeline

  • Full Byte Order Mark (BOM) Support:
    • Automatically recognizes and strips UTF-8 with BOM (0xEF 0xBB 0xBF).
    • Seamlessly decodes UTF-16 Little Endian (LE) with BOM (0xFF 0xFE) — natively opening files like DJI camera logs (DJI_*.txt), MediaInfo dumps, and Windows PowerShell exports.
    • Seamlessly decodes UTF-16 Big Endian (BE) with BOM (0xFE 0xFF).
  • BOM-less UTF-16 LE Detection:
    • Implements a lightweight heuristic to detect UTF-16 LE files lacking standard BOM headers by analyzing character byte alignment, preventing decoding failures on raw streams.
  • Native Windows ANSI / System ACP Fallback:
    • For legacy text documents encoded in Windows-1252, ISO-8859, or regional system code pages containing special punctuation (curly quotes “ ”, em-dashes —, currency symbols €, and accents é), Cathet automatically decodes them using the native Win32 MultiByteToWideChar API without garbled characters.
  • Intelligent Binary Guard:
    • Preserves the safety shield against accidentally opening .exe, .png, or .zip archives by verifying null-byte distributions and gracefully showing the frosted glass warning modal.

🏛️ Architecture & Code Quality

  • Dedicated Domain Module (src-tauri/src/encoding.rs):
    • Decomposed text decoding logic out of file.rs into an isolated, single-responsibility module (encoding.rs, 165 lines).
    • Reduced commands/file.rs down to 166 lines, strictly honoring Cathet's anti-monolith standard (< 250 lines per file).
  • Zero-Bloat Win32 Integration:
    • Enabled Win32_Globalization on the existing windows-sys dependency, leveraging built-in Windows kernel functions without pulling any third-party decoding crates.
    • Release binaries strictly preserve the sub-4 MB footprint invariant.
  • Lossless Markdown Guarantee (Ctrl+M):
    • All non-UTF-8 files are normalized into standard Unicode at the Rust backend boundary before hitting Tauri IPC.
    • Toggling between Edit mode and Markdown Preview mode remains 100% idempotent and lossless.
  • Automated Unit Test Suite:
    • Integrated native test cases covering plain UTF-8, UTF-8 BOM, UTF-16 LE/BE, ANSI fallbacks, binary guards, and real-world DJI metadata files.

📦 Commits Included

  • 3de554c — feat(file): add universal text decoder supporting UTF-16, BOMs, and Windows ANSI
  • 657962c — feat: bump version