Fix reading OBJ meshes from UTF-8 paths on Windows - #7524
Conversation
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
|
Hi @Fstarnb, thanks for submitting this fix. Have you checked if the latest (main branch) of tinyobjloader fixes this? Its easier to update versions than have special workarounds in Open3D. Alternately, will adding "/utf-8" to MSVC compile options fix this? |
Document the FileOBJ stream/FReadToBuffer change for issue isl-org#7336 / PR isl-org#7524.
|
@ssheorey Thanks for the review questions — I checked both options carefully. 1. Does latest tinyobjloader main already fix this?Yes on main, no on the pin Open3D uses. Open3D currently vendors tinyobjloader v2.0.0rc8 ( On tinyobjloader main (post-rc8), the filename I did not bump the third-party pin in this PR because:
If you prefer a dedicated follow-up to bump tinyobjloader once there is a tagged release (or a pinned commit you trust), happy to do that separately. This PR stays a minimal, pin-safe fix for #7336. 2. Would MSVC
|
Read OBJ/MTL via filesystem::FReadToBuffer (UTF-8 aware FOpen) and tinyobj stream APIs instead of narrow fopen paths. Fixes isl-org#7336.
Document the FileOBJ stream/FReadToBuffer change for issue isl-org#7336 / PR isl-org#7524.
d040636 to
7726e7b
Compare
|
Follow-up: rebased onto current |
Description
ReadTriangleMeshFromOBJusedtinyobj::LoadObj(filename, ...), which opens the path with narrowfopen/ifstream. On Windows that breaks when the path contains non-ASCII characters (e.g. Korean), while ASCII PLY paths work because other loaders useutility::filesystem::FOpen/FReadToBuffer(UTF-8 → wide open).This change:
.objbytes throughFReadToBuffertinyobj::LoadObjstream overload.mtlfiles with a smallMaterialReaderthat also usesFReadToBuffer+MaterialStreamReaderRelated Issue
Fixes #7336
Checklist