locale: LC_ALL=french; export LC_ALL
Carlos Pereira <[email protected]> Wed, 12 Mar 2008 22:51:32 +0000
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
Dear all, I received a complain that my Expat app does not read dot-based decimal numbers when locale is set to a comma-based country, such as France: LC_ALL=french; export LC_ALL If I have this: <element x="1.0" y="1.0"/> x, y are not understood as proper float numbers, when locale defines commas for decimal separators. And vice-versa: commas are not accepted when locale is the default (or presumably locales such as US). I think the ideal solution would be: when importing files, accept both dots and commas, so for example this XML line should be acceptable: <element x="1.0" y=2,0"/> Then do all the work in the locale chosen decimal separator. So a US user would work and export with dots, send the file to his french friend, who reads the dots and then works with commas, export with commas, send the file back to the US user who reads the commas without problems. Is there a simple way to allow simultaneously dots and commas in the same XML file, with Expat? or at least all dots in one file and all commas in another, and be able to read both? is this actually allowed in the XML specification? Carlos