<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Thank you David for your quick answer!<div class=""><br class=""></div><div class="">If I have some time I will do those fixes and send a patch.</div><div class=""><br class=""></div><div class="">Romain</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 28 août 2017 à 17:03, David Gobbi <<a href="mailto:david.gobbi@gmail.com" class="">david.gobbi@gmail.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi Romain,</div><div class=""><br class=""></div>I suspect that VTK could be fixed if someone simply added a call to "imbue(std::locale::classic())" to vtkDataWriter::OpenVTKFile(), e.g.:<div class=""><br class=""></div><div class=""> fptr = new std::ostringstream;<br class=""><div class=""> fptr->imbue(std::locale::classic());</div><div class=""><br class=""></div><div class="">and</div><div class=""><br class=""></div><div class=""> fptr = new ofstream(this->FileName, ios::out);<br class=""></div><div class=""> fptr->imbue(std::locale::classic());</div><div class=""><br class=""></div><div class="">If you have built VTK from source, you can try making the above change to see if it fixes the issue (the vtkDataSetReader might also need to be fixed, as well as many other IO classes).</div><div class=""><br class=""></div><div class=""> - David<div class=""><div class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Aug 28, 2017 at 8:33 AM, Romain LEGUAY <span dir="ltr" class=""><<a href="mailto:romain.leguay@gmail.com" target="_blank" class="">romain.leguay@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi everyone,<br class="">
<br class="">
I have a little issue when I try to write then read a polydata.<br class="">
<br class="">
This is the code I use to write then read my polydata inside a string (not a file):<br class="">
<br class="">
// Writing part<br class="">
vtkSmartPointer<<wbr class="">vtkPolyDataWriter> writer = vtkSmartPointer<<wbr class="">vtkPolyDataWriter>::New();<br class="">
writer->WriteToOutputStringOn(<wbr class="">);<br class="">
writer->SetInputData(<wbr class="">myPolyData);<br class="">
writer->Update();<br class="">
<br class="">
char * data = writer->GetOutputString();<br class="">
<br class="">
<br class="">
// Reading part<br class="">
vtkSmartPointer<<wbr class="">vtkPolyDataReader> polyReader = vtkSmartPointer<<wbr class="">vtkPolyDataReader>::New();<br class="">
polyReader-><wbr class="">ReadFromInputStringOn();<br class="">
polyReader->SetInputString(<wbr class="">data);<br class="">
polyReader->Update();<br class="">
vtkSmartPointer<vtkPolyData> polyData = polyReader->GetOutput();<br class="">
<br class="">
<br class="">
Unfortunately, when I try to read the data, I have some error indicating some Unrecognized symbols: the decimal mark is a comma instead of a dot.<br class="">
<br class="">
Can we change easily this comportement or force VTK to write with dot decimal mark?<br class="">
<br class="">
I know the command std::setlocale but I would like to know if there is another way to fix this problem.<br class="">
<br class="">
Thank you!<br class="">
<br class="">
Romain<br class=""></blockquote></div></div></div></div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>