[Expat-discuss] locale: LC_ALL=french; export LC_ALL

Nick MacDonald nickmacd at gmail.com
Thu Mar 13 17:38:45 CET 2008


Carlos:

Although I have used eXpat, I don't profess to be an expert.  However,
in my limited experience, I can't see how you could encounter the type
of problem you are referring to.  You didn't give any specific error
message, or in fact any definite indication of what component might be
failing, but I can't see how it could be eXpat.  In my experience,
eXpat does NOT interpret the data, it just supplies it to your
program, and you need to make an interpretation.  Accordingly, I
suspect the problem is inside your app and how you use the resulting
data from eXpat, and not with eXpat itself.

Good luck,
  Nick

On Wed, Mar 12, 2008 at 6:51 PM, Carlos Pereira
<jose.carlos.pereira at ist.utl.pt> wrote:
> 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



-- 
Nick MacDonald
NickMacD at gmail.com


More information about the Expat-discuss mailing list