Ethereal-dev: Re: [Ethereal-dev] Bug report : filter engine for float with LANG =="fr_FR"

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 27 Oct 2003 14:52:52 -0800

On Oct 27, 2003, at 1:07 PM, Pierre JUHEN wrote:

In French, float are represented with a comma instead of a dot.

In most if not all of Continental Europe, as I understand it, a comma rather than a dot is used as a "decimal point" (and the reverse applies to thousands separator).

Using it with match doesn't work. Filter engine says " , unexpected in this context".

It doesn't work even by replacing the comma by a dot.

But you probably get a different error:

	"123.456" is not a valid number.

or something such as that.

I am not an expert of "locale",  so, I am not able to propose a patch.

It's not a locale issue, it's a lexical analyzer issue; the lexical analyzer needs to allow ',' as a character in an "unparsed string".

I've checked in a change to allow that (and to allow '+' as a character in an "unparsed string", so you can do 1.234e+5 or 1,234e+5). That change doesn't affect the code that parses the resulting string, so whether a comma or a dot is allowed as a decimal point depends on the locale you're in. (I tried the patched version with LANG set to "fr_FR", and it allowed 1,234e+5 but didn't allow 1.234e+5.)

I've attached a patch for the change I checked in.

Attachment: patch
Description: Binary data