MantisBT - VTK
View Issue Details
0012948VTK(No Category)public2012-02-20 05:552016-08-12 09:55
Hanno Hugenberg 
Dave DeMarle 
normalminorhave not tried
closedmoved 
5.8.0 
 
TBD
incorrect functionality
0012948: Localization problem with human readable file formats (obj, ply, ... )
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.
No tags attached.
related to 0012121closed Dave DeMarle STL reader internationalisation screws up 
Issue History
2012-02-20 05:55Hanno HugenbergNew Issue
2012-02-20 05:58Hanno HugenbergNote Added: 0028307
2013-06-05 15:30Jean-Christophe Fillion-RobinRelationship addedrelated to 0012121
2013-07-22 16:44Dave DeMarleNote Added: 0031173
2013-07-22 16:44Dave DeMarleStatusbacklog => expired
2013-07-22 16:44Dave DeMarleResolutionopen => fixed
2013-07-22 16:44Dave DeMarleAssigned To => Dave DeMarle
2013-07-22 16:44Dave DeMarleResolutionfixed => open
2016-08-12 09:55Kitware RobotNote Added: 0037268
2016-08-12 09:55Kitware RobotStatusexpired => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved

Notes
(0028307)
Hanno Hugenberg   
2012-02-20 05:58   
Localization is automaticaly changed, if you use for example QT with German settings.
So it happens without changing the localization via "setlocale()" "locale.h" by yourself.
(0031173)
Dave DeMarle   
2013-07-22 16:44   
If this is still a problem in 6.0, please reopen this bug.
(0037268)
Kitware Robot   
2016-08-12 09:55   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.