raw encoding in AppendedData in a vtkXML file fails to load in ParaView
I've been banging my head against this all day now. I would like my program to write compact .vtu files for easy reading into ParaView. base64 encoding increases file size over raw and introduces extra dependencies into my code, so I'd like to avoid it; as I would like to avoid the heavy dependency of linking directly into VTK. All of the documentation I see tells me that raw encoding is available in AppendedData, and writing XML myself seems easy (I use tinyxml2).
Most reports of problems using raw-encoded data in .vtu files stem from the author forgetting the (usually) 4-byte precusror to the raw data block. This precursor tells the reader how many bytes are in the following raw data block. I have this precursor, I have header_type="UInt32" in my header, and I write a uint32_t to my appended data block just after the underscore and before the raw data.
Yet ParaView (using VTK) still fails to read it, with
ERROR: In /builddir/build/BUILD/ParaView-v5.4.1/VTK/IO/XMLParser/vtkXMLParser.cxx, line 399 vtkXMLDataParser (0x56290e8a2450): Error parsing XML in stream at line 18, column 2, byte index 1720: mismatched tag
Which is funny, because that's the line after the AppendedData section, and the underscore is at byte 1718, and the uint32_t at bytes 1719-1722.
The test file is attached. Only one PointData field is in AppendedData, as all ascii-encoded data reads just fine. When I encode this failing data as ascii, it reads correctly.
I'm using ParaView 5.4.1, which pulled a VTK from sometime (I can't figure that out from github). broken.vtu