[vtkusers] Problem reading a vtk-file with vtkStructuredGridReader

Thomas Obenaus thomaso at eas.iis.fraunhofer.de
Wed Dec 17 05:48:54 EST 2008


Mathieu Malaterre wrote:
> On Tue, Dec 16, 2008 at 10:04 AM, Thomas Obenaus
> <thomaso at eas.iis.fraunhofer.de> wrote:
>   
>> Hi everybody,
>>
>> I'm trying to read vtk-files which contain data of the type
>> vtkStructuredGrid. Using the vtkStructuredGridReader for this task is easy
>> and returns the content of the vtk-file in most cases. But in case the
>> filename or the path to the file contains a non-english character like
>> (ö,ä,ü,...) the reader returns the following error-message
>> "CANNOT_OPEN_FILE_ERROR (20002) reading file: D:\TEMP\Neuer
>> Ordner\bfeld.vtk". Considering the example below I used to create the error,
>> I think its a problem of missing unicode support because the "ö" in the
>> filename böfeld.vtk is filtered out so that the reader can't find the file
>> bfeld.vtk
>>
>> vtkStructuredGridReader reader = new vtkStructuredGridReader( );
>> reader.SetFileName( "D:\\TEMP\\Neuer Ordner\\böfeld.vtk" );
>> reader.Update( );
>>
>> My question is how can I workaround this problem?
>>     
>
> Use the short name version of the filename (8 chars + max 3 chars file
> extension).
>
> 2cts
Hi Mathieu,

I think the length of the filename is not the problem because the 
following example doesn't work too:

VTK_ERROR - 2008-12-17 11:43:02 - NO_ERROR (0) reading file:  D:\wr\bf.vtk
VTK_ERROR - 2008-12-17 11:43:02 - CANNOT_OPEN_FILE_ERROR (20002) reading 
file:  D:\wr\bf.vtk

The correct path have to be D:\wör\bf.vtk and not D:\wr\bf.vtk.

Thomas.




More information about the vtkusers mailing list