Re: [gupnp] [PATCH 2/2] Use locale-independent float <-> string conversions



On Tue, 2010-09-14 at 10:40 +0200, Sven Neumann wrote:
> On Tue, 2010-09-14 at 10:09 +0200, Sven Neumann wrote:
> > Read and write floats and doubles using the '.' as decimal
> > separator, independent of the locale that is currently in use.
> 
> The current code uses atof() and printf() to read and write floating
> point values used as parameters in UPnP actions. These functions will
> act differently depending on the locale that is currently in use. The
> patch changes this to use the locale-independent functions from glib
> instead.

To keep you from having to look this up. Here's the relevant part of the
specification (UPnP Device Architecture v1.1):

float

  Floating point number. Mantissa (left of the decimal) and/or
  exponent MAY have a leading sign. Mantissa and/or exponent MAY
  have leading zeros, which SHOULD be ignored by the recipient.
  Decimal character in mantissa is a period, i.e., whole digits
  in mantissa separated from fractional digits by period (“.”).
  Mantissa separated from exponent by “E”. (No currency symbol.)
  (No grouping of digits in the mantissa, e.g., no commas.)


Sven


--
To unsubscribe send a mail to gupnp+unsubscribe\@o-hand.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]