ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: [Ethereal-dev] Bug with localized decimal separator

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Lars Ruoff" <Lars.Ruoff@xxxxxxxxxx>
Date: Fri, 11 Mar 2005 10:32:15 +0100
Hi,
i want to point out again a bug that has been around since a fair amount of
time now and should be adressed. (I pointed that out already once ago but it
got forgotten).
The bug is a problem with a localization issue (at least) on Windows with
most central european locale settings, where the floating point decimal
separator character is the comma "," instead of the decimal point "." .

Apparently, on systems with coresponding settings (i have no idea which
system setting that actually is), the g_XXX_printf-family of functions
produce the localized decimal separator when used with float values ("%f").

This has the following undesireable effects:
A - When used in CList columns with column sorting, the sorting on such a
column won't work because atof() does not recongnize the localized decimal
seperator and expects the point "." instead.

B - When exporting a CList to CSV format, the exported data is unusable,
since the comma "," is used as both the column- and decimal separator.

The problem is apparent in
rtp_stream_dlg, (where besided of column-sorting, i also want to add a
CSV-export)
rtp_analysis,
[any other dialog with a CList having columns with float data and using
column sort and/or CSV export - to be completed]

Has anybody experienced the same problem so far?

As a solution, especially for the CSV-export problem, i suggest ignoring any
localization settings alltogether. But what to use for replacement of
g_XXX_printf?

regards,
Lars Ruoff.