Skip to content

Fixes for UTF8 filenames with C++20 - #2073

Merged
jminor merged 3 commits into
AcademySoftwareFoundation:mainfrom
darbyjohnston:cxx20_utf8_fixes
Oct 22, 2026
Merged

jminor merged 3 commits into
AcademySoftwareFoundation:mainfrom
darbyjohnston:cxx20_utf8_fixes

Conversation

@darbyjohnston

Copy link
Copy Markdown
Collaborator

In C++20 the return type for std::filesystem::path::u8string() was changed from std::string to std::u8string which breaks the existing code. This PR adds helper functions for the conversions that work with both C++17 and C++20, and updates the bundle code to use them. It also adds non-ASCII names to the bundle round-trip tests which previously only used ASCII.

Note that std::filesystem::path::string() doesn't work as a replacement because on Windows it doesn't return UTF-8.

These changes are needed for the C++20 support in #2071.

Assisted-by: Claude:claude-opus-5-5 [implementation] [testing]

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
@codecov-commenter

codecov-commenter commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.88235% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.61%. Comparing base (f8a2f36) to head (44cb0e2).

Files with missing lines Patch % Lines
src/opentimelineio/bundle.cpp 50.00% 15 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2073   +/-   ##
=======================================
  Coverage   83.60%   83.61%           
=======================================
  Files         182      183    +1     
  Lines       13575    13579    +4     
  Branches     1261     1261           
=======================================
+ Hits        11350    11354    +4     
  Misses       2052     2052           
  Partials      173      173           
Flag Coverage Δ
py-unittests 83.61% <55.88%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/opentimelineio/stringUtils.h 100.00% <100.00%> (ø)
src/opentimelineio/bundle.cpp 48.80% <50.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8a2f36...44cb0e2. Read the comment docs.

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

@darbyjohnston

Copy link
Copy Markdown
Collaborator Author

Note that the C++ example file is not set up to handle UTF-8 so it just uses string() for convenience. Adding UTF8 support would also require adding a separate Windows specific main function (wmain) which might be too complex for the example.

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
The error and zip64 tests passed UTF-8 strings straight to std::filesystem,
which reads a plain string in the native encoding. That is the code page on
Windows, so with a non-ASCII temporary directory -- a user name with an
accent is enough -- the files were not found, and a test could fail on a
developer's machine while passing on CI.

Signed-off-by: Darby Johnston <darbyjohnston@yahoo.com>
@jminor
jminor merged commit ad11cf1 into AcademySoftwareFoundation:main Oct 22, 2026
89 of 117 checks passed
@darbyjohnston darbyjohnston added this to the 0.19.0 milestone Oct 22, 2026
@darbyjohnston darbyjohnston added the bug A problem, flaw, or broken functionality. label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A problem, flaw, or broken functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants