Many file formats that VTK supports are text-based. Ideally, for each file format you would check if there is any guidance on how to handle special characters.
If there is guidance (e.g., for DICOM and XML based formats), then you need to implement that.
If there is no guidance, then you can define a sensible behavior. You can write as UTF-8, or if that breaks commonly used parsers then force ASCII. For reading, you may use some heuristics, such as checking BOM and/or check if the content can be successfully interpreted as UTF-8. Some files are mixed text/binary/base64, so you may need to extract text components before you are trying to guess its encoding.
These should be all doable, but requires some effort. You cannot ignore the file content.