[vtk-developers] [VTK 0012948]: Localization problem with human readable file formats (obj, ply, ... )

Mantis Bug Tracker mantis at public.kitware.com
Mon Feb 20 05:55:47 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.vtk.org/Bug/view.php?id=12948 
====================================================================== 
Reported By:                Hanno Hugenberg
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   12948
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       incorrect functionality 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-02-20 05:55 EST
Last Modified:              2012-02-20 05:55 EST
====================================================================== 
Summary:                    Localization problem with human readable file
formats (obj, ply, ... )
Description: 
Loading and writing of human readable file formats fails if a localisation for a
program is used, which changes the representation of float values.

Bugreport is created after a discussion on the user mailing list:

http://www.vtk.org/pipermail/vtkusers/2012-February/121416.html

The reader/writer classes e.g. "vtkOBJReader"

are using sscanf for reading float values from the files.
Problem is:
- the obj standard describes the use of '.' float values like "1.7"
- if a program changes the localisation to a form which uses e.g. ',' as a float
decimal seperator like "1,7", the Reader and Writer classes are not able to load
obj files anymore.

Since the Reader/Writer have to verify that it is always reading the standard
float values, i suggest the use of 

sscanf_l() and sprintf_l() calls (which should be supported by various
plattforms.

A different apporoach would be saveing the global localisation, set it for the
time of reading to the compatible mode "c" and then set it back to the former
values. But this would be a hack.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-02-20 05:55 Hanno HugenbergNew Issue                                    
======================================================================




More information about the vtk-developers mailing list