Skip to content

fix: rename em-dash asset filenames to ASCII hyphens#433

Merged
didiergarcia merged 1 commit intomainfrom
fix/em-dash-asset-filenames
Apr 28, 2026
Merged

fix: rename em-dash asset filenames to ASCII hyphens#433
didiergarcia merged 1 commit intomainfrom
fix/em-dash-asset-filenames

Conversation

@didiergarcia
Copy link
Copy Markdown
Contributor

Summary

  • Renames two imagesets and their PNGs under Examples/apps/SegmentExtensionsExample/Assets.xcassets/ to drop em-dash (U+2014, ) characters in favor of ASCII hyphens (-).
  • Updates the filename keys in both Contents.json files and the 4 image="..." / <image name="..."/> references in Main.storyboard that named them.

Why

GitHub's auto-generated source archive for each tag encodes the em-dashes as UTF-8 in ZIP entries. The default macOS unzip (Info-ZIP) can't decode those entries and aborts with:

checkdir error: cannot create .../Segment———Avatar———Green.imageset: Illegal byte sequence

The same extraction path is used by Xcode when resolving this package via SPM from a tag/archive, so downstream consumers see an "unzipping failed" error and can't install the package.

Repro (on stock macOS, before this fix):

curl -L https://github.com/segmentio/analytics-swift/archive/refs/tags/1.9.2.zip -o broken.zip
unzip broken.zip
# -> checkdir error: ... Illegal byte sequence

Fixes #431.

Scope

  • Only 4 on-disk files renamed (imagesets + PNGs) using git mv so history is preserved.
  • Only 6 text references updated — 2 in Contents.json, 4 in Main.storyboard.
  • Nothing else in the repo referenced the em-dash paths (grep -rn $'—' . and find . -name '*—*' are both empty after this change).
  • project.pbxproj is untouched — it references Assets.xcassets as a folder, not individual imagesets.
  • No Swift source, no Package.swift, no SDK behavior changes.

Test plan

  • Open Examples/apps/SegmentExtensionsExample/SegmentExtensionsExample.xcworkspace in Xcode, build + run on iOS Simulator, confirm both images still render (Twilio/Segment horizontal logo on splash, avatar on the main view).
  • After tag/release: curl -L https://github.com/segmentio/analytics-swift/archive/refs/tags/<next>.zip -o test.zip && unzip test.zip completes cleanly with no Illegal byte sequence.
  • In a fresh consumer project, resolve the package via SPM at the new tag and confirm no "unzipping failed" error.

The asset files and paths under
Examples/apps/SegmentExtensionsExample/Assets.xcassets used em-dash (U+2014,
"—") characters in their names. GitHub's auto-generated source archive
(https://github.com/segmentio/analytics-swift/archive/refs/tags/<tag>.zip)
encodes these as UTF-8, but the default macOS unzip (Info-ZIP) cannot
decode them and aborts with "checkdir error: ... Illegal byte sequence".
This in turn breaks Xcode Swift Package Manager resolution for any
consumer whose environment extracts the archive with that unzip.

Rename the two imagesets and their PNGs to use ASCII hyphens ("-"),
and update the Contents.json filename keys plus the four Main.storyboard
image references that name them.

Fixes #431
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.17%. Comparing base (b511158) to head (1466620).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #433      +/-   ##
==========================================
- Coverage   73.84%   73.17%   -0.68%     
==========================================
  Files          54       54              
  Lines        5425     4063    -1362     
==========================================
- Hits         4006     2973    -1033     
+ Misses       1419     1090     -329     

see 54 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@didiergarcia didiergarcia merged commit 27fcc10 into main Apr 28, 2026
17 of 18 checks passed
@didiergarcia didiergarcia deleted the fix/em-dash-asset-filenames branch April 28, 2026 15:16
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.

SPM extraction fails while unzipping analytics-swift 1.9.1 due to em dash filenames

2 participants