
Globalization has you
Posted Tuesday, 29 June, 2010 - 09:52 by teolog| Project: | Meshomatic |
| Version: | 0.2.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | fixed |
Jump to:
Description
ObjLoader not working on non english system.
float x = float.Parse(parameters[1]) failed, on some regional settings float format "0,xxxx", but not "0.xxxx".
Needs to using
CultureInfo intern=new CultureInfo("en-US", false);
NumberFormatInfo nfi =intern.NumberFormat;
float x = float.Parse(parameters[1],nfi);


Comments
#1
IIRC, the suggested solution is to use CultureInfo.InvariantCulture when saving/loading files to/from disk.
#2
I can only second The Fiddler's suggestion, when dealing with a defined floating string format use something like
#3
Quite correct. I will fix this when/if I ever get back around to this project.
#4
Fixed in 0.3.0