[Mono-dev] [PATCH] ASP.NET - make FontUnit NOT use locale-dependent decimal separator
Marek Habersack
grendello at gmail.com
Thu Feb 15 08:51:40 EST 2007
On Mon, 12 Feb 2007 22:02:28 +0100, "Gert Driesen" <gert.driesen at telenet.be>
scribbled:
[snip]
> > - you will get an exception thrown, because the Unit constructor cannot
> > parse the passed 0.9em value with cultures which have a decimal
> > separator different to a dot. In other words, Unit (and FontUnit) in
> > mono right now expect culture-dependent input while it gets the CSS
> > decimal font size, which will always use the dot as a separator.
> > ASP.NET parser uses the FontUnit(string) constructor - and that one, in
> > turn, invokes the FontUnit(string, CultureInfo) one. By saying that the
> > behavior is not MS-compatible, are you claiming that Microsoft parse
> > the 0.9em value and turn it into locale-specific form (e.g.
> > 0,9em) before passing it to the first FontUnit constructor above?
>
> Apparently, MS uses FontUnitConverter.ConvertFromInvariantString to parse
> the value:
>
> [FormatException]: The numeric part ('3,5') of '3,5em' cannot be parsed as a
[snip]
The difference between us and MS.NET was that we did the parsing also on the
runtime. The attached diff fixes the issue by generating different code on the
runtime. Please review, thanks
marek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FontUnit_culture.diff
Type: text/x-patch
Size: 1574 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070215/7fd8a04b/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070215/7fd8a04b/attachment-0001.bin
More information about the Mono-devel-list
mailing list