Skip to content

[tracer] The tests write a zip's UTF-8 names in a UTF-8 locale, which FreeBSD's libarchive needs - #49

Merged
DraChimeraVee merged 1 commit into
mainfrom
dravee/tracer/zip-names-freebsd
Nov 8, 2026
Merged

DraChimeraVee merged 1 commit into
mainfrom
dravee/tracer/zip-names-freebsd

Conversation

@DraChimeraVee

Copy link
Copy Markdown
Contributor

The deploy of #45, #46 and #48 stopped at the FreeBSD build's tests: 1486 of 1488 checks passed in the scarletnx jail on devola. The two that failed read a zip's name captura_é, and got captura_?.

The reader is not at fault. The tests' own zip_bytes() writes its zips with libarchive in the C locale a test runs in. In the scarletnx jail (FreeBSD 15.1, libarchive 3.8.7), the writer turns é into ? in that locale, even with hdrcharset=UTF-8. glibc's libarchive writes the bytes as they are, so Linux never saw it. Measured in the jail:

zip written bytes after captura_ read under uselocale(C.UTF-8)
in the C locale (as now) 3f 2e captura_?.png
under uselocale(C.UTF-8) c3 a9 captura_é.png

Reading a zip written with the name's bytes gives captura_é.png, with the archive opened in the C locale or in C.UTF-8. That is names_utf8() as tr_zip_next() uses it.

zip_bytes() now writes its names under uselocale(C.UTF-8) and puts the thread's locale back after. Only the tests change.

  • make test in tracer/, Linux: 1491 of 1491.
  • The same tree in the scarletnx jail: 1488 of 1488.

… FreeBSD's libarchive needs

Signed-off-by: AO55 <AO55@reden-emu.dev>
@DraChimeraVee
DraChimeraVee merged commit 9a13058 into main Nov 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants