Skip to content

docs(iconv): design minimal FilenameConverter trait (#1910)#3517

Merged
oferchen merged 2 commits into
masterfrom
docs/iconv-filename-converter-design-1910
May 1, 2026
Merged

docs(iconv): design minimal FilenameConverter trait (#1910)#3517
oferchen merged 2 commits into
masterfrom
docs/iconv-filename-converter-design-1910

Conversation

@oferchen
Copy link
Copy Markdown
Owner

@oferchen oferchen commented May 1, 2026

Summary

Audit confirms a FilenameConverter already exists at
crates/protocol/src/iconv/converter.rs as a concrete struct backed by
encoding_rs. Task #1910 therefore reduces to a confirm-and-document
exercise, with three minor refinement recommendations rather than
mandates:

  • Rename the byte-oriented Cow methods (local_to_remote /
    remote_to_local) to align with the tracker description
    (convert_send / convert_recv) and promote &Path / Cow<Path>
    to the public boundary.
  • Surface the unsupported-charset case as an rsync_error!(1, ...)
    rather than the current silent tracing::warn! -> None fallback.
  • Align with Switch Windows cross-compilation to native cargo builds #1915 on the no-feature stub (hard error at config build
    when --iconv is supplied without the iconv Cargo feature).

The audit also documents the three application sites that need a
converter (sender flist emit, receiver flist ingest, filter-rule path
matching), justifies the struct-not-trait recommendation, defends
encoding_rs over system iconv on cross-platform / unsafe-policy
grounds, and confirms crates/protocol/src/iconv/ as the correct
home crate.

This is the design follow-on to PR #3514
(docs/audits/iconv-parse-deadend.md) and unblocks the wiring tasks
#1911-#1919.

Test plan

  • CI checks pass

Related

Audit confirms FilenameConverter already exists at
crates/protocol/src/iconv/converter.rs as a concrete struct backed by
encoding_rs. Task #1910 reduces to confirm-and-document plus three
minor refinement recommendations (rename byte-oriented Cow methods to
convert_send/convert_recv, surface unsupported-charset errors instead
of swallowing them, and align with #1915 on the no-feature stub).
Documents the three application sites (sender flist emit, receiver
flist ingest, filter-rule path matching), justifies the struct-not-
trait choice, the encoding_rs backing, and the protocol-crate home,
and lays out the wiring plan that unblocks #1911-#1919.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 1, 2026
@oferchen oferchen merged commit ab3867f into master May 1, 2026
11 checks passed
@oferchen oferchen deleted the docs/iconv-filename-converter-design-1910 branch May 1, 2026 21:08
oferchen added a commit that referenced this pull request May 5, 2026
Audit confirms FilenameConverter already exists at
crates/protocol/src/iconv/converter.rs as a concrete struct backed by
encoding_rs. Task #1910 reduces to confirm-and-document plus three
minor refinement recommendations (rename byte-oriented Cow methods to
convert_send/convert_recv, surface unsupported-charset errors instead
of swallowing them, and align with #1915 on the no-feature stub).
Documents the three application sites (sender flist emit, receiver
flist ingest, filter-rule path matching), justifies the struct-not-
trait choice, the encoding_rs backing, and the protocol-crate home,
and lays out the wiring plan that unblocks #1911-#1919.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant