Skip to content
Snippets Groups Projects
Commit 0e92ee13 authored by David Gobbi's avatar David Gobbi
Browse files

Use wide paths for TIFF on Win32 for utf-8 support

parent 75edb9be
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,8 @@
#include "vtkImageData.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtksys/Encoding.hxx"
#include "vtksys/SystemTools.hxx"
#include <algorithm>
......@@ -146,7 +148,12 @@ bool vtkTIFFReader::vtkTIFFReaderInternal::Open(const char* filename)
{
return false;
}
#if defined(_WIN32)
std::wstring widepath = vtksys::Encoding::ToWide(filename);
this->Image = TIFFOpenW(widepath.c_str(), "r");
#else
this->Image = TIFFOpen(filename, "r");
#endif
if (!this->Image)
{
this->Clean();
......
......@@ -11,6 +11,8 @@
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtk_tiff.h"
#include "vtksys/Encoding.hxx"
#include <sstream>
#include <vector>
......@@ -160,7 +162,12 @@ void vtkTIFFWriter::WriteFileHeader(ostream*, vtkImageData* data, int wExt[6])
// Large image detected, use BigTIFF mode
writeMode << "8";
}
#if defined(_WIN32)
std::wstring widepath = vtksys::Encoding::ToWide(this->InternalFileName);
TIFF* tif = TIFFOpenW(widepath.c_str(), writeMode.str().c_str());
#else
TIFF* tif = TIFFOpen(this->InternalFileName, writeMode.str().c_str());
#endif
if (!tif)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment