MetaIO icon indicating copy to clipboard operation
MetaIO copied to clipboard

Please reinstate the stream macro

Open todoooo opened this issue 4 years ago • 3 comments

Some time ago the METAIO_STREAM macro was removed from MetaIO and the new code, which uses std::ifstream/ofstream , breaks unicode compliance in VTK. See https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6716#note_908828

VTK uses vtksys::ifstream/ofstream to support utf8 path and filenames across all platforms, so please reinstate the macro to allow VTK to function correctly with non-English characters on Windows.

todoooo avatar Feb 24 '21 22:02 todoooo

Was the METAIO_STREAM ever something else than a pointer to std? The vtksys::i/ofstream is a new development I believe?

I have tried to address (a limited subset of) this problem in https://github.com/Kitware/MetaIO/pull/113, maybe you would have some comments on my attempted solution there?

codeling avatar Aug 10 '22 12:08 codeling

What is needed is to replace Ifstream/iostream in METAIO with their vtksys equivalents, as has been done in VTK and Paraview e.g. https://gitlab.kitware.com/paraview/paraview/-/merge_requests/3850 The METAIO_STREAM macro can be used to achieve this for both VTK and ITK.

todoooo avatar Aug 10 '22 13:08 todoooo

+1

Wish it hadn't been removed. @hjmjohnson - do you recall the reason for removing it?

aylward avatar Aug 11 '22 02:08 aylward