Page MenuHome

Fix new Wavefront OBJ exporter not saving non-English filenames properly on Windows
ClosedPublic

Authored by Aras Pranckevicius (aras_p) on Jan 20 2022, 9:38 AM.

Details

Summary

On Windows, C/C++ standard libraries do not use UTF-8 filenames, and hence a wrapper function that converts into UTF-16 is needed, i.e. fopen -> BLI_fopen.

Fixes T95044.

Before the fix, trying to export a file with a name like testąčęėįšųū.obj resulted in file with testąčęėįšųū.obj name on Windows.

Diff Detail

Repository
rB Blender

Event Timeline

Aras Pranckevicius (aras_p) requested review of this revision.Jan 20 2022, 9:38 AM
Aras Pranckevicius (aras_p) created this revision.

Suggest adding a test also obj_exporter_tests.cc

Suggest adding a test also obj_exporter_tests.cc

Makes sense. Need first to learn how to run the tests :) And then fixup the obj_exporter_tests.cc since they use std::ifstream directly for reading the OBJ files, which has the same filename mangling issue on Windows.

Extended obj tests to use test filename with non-English characters

Looks good to me.

This revision is now accepted and ready to land.Jan 21 2022, 10:53 PM