# Wide String Support for VTK Writers

**URL:** https://discourse.vtk.org/t/wide-string-support-for-vtk-writers/4797
**Category:** Support
**Created:** [December 9, 2020, 6:25pm UTC](https://discourse.vtk.org/t/wide-string-support-for-vtk-writers/4797 "2020-12-09T18:25:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mdh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mdh/32/2245_2.png) [@mdh](https://discourse.vtk.org/u/mdh)
#### Post date: [December 9, 2020, 6:25pm UTC](https://discourse.vtk.org/t/wide-string-support-for-vtk-writers/4797/1 "2020-12-09T18:25:04Z")

</div>

In VTK 8, vtkDataWriter::SetFileName() accepts only normal strings and vtkDataWriter::OpenVTKFile() uses ofstream to open the output file for writing. Is there a plan to add wide-character support to these methods in the future?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [December 9, 2020, 6:36pm UTC](https://discourse.vtk.org/t/wide-string-support-for-vtk-writers/4797/2 "2020-12-09T18:36:17Z")

</div>

VTK already uses UTF-8 encoding for strings for all its public APIs. Since UTF-8 codepage is available now on all major operating systems, there should be no reason to use fixed wide strings in applications.

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [December 9, 2020, 10:17pm UTC](https://discourse.vtk.org/t/wide-string-support-for-vtk-writers/4797/3 "2020-12-09T22:17:43Z")

</div>

VTK 8.2+ no longer uses std::ofstream/ifstream. It uses vtksys::ofstream/ifstream which makes the software unicode compliant. When crossing the DLL boundary users are expected to pass string/char\* method parameters using utf8 encoding and text results are returned with utf8 encoding.

The Python and Java wrappers already have this conversion built into their string types.
