[Mono-dev] [PATCH] ASP.NET - make FontUnit NOT use locale-dependent decimal separator

Marek Habersack grendello at gmail.com
Mon Feb 12 08:32:27 EST 2007

On Sat, 10 Feb 2007 14:28:54 +0100, "Gert Driesen" <gert.driesen at telenet.be>

> > -----Original Message-----
> > From: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-
> > bounces at lists.ximian.com] On Behalf Of Marek Habersack
> > Sent: zaterdag 10 februari 2007 6:20
> > To: Mono Development List
> > Subject: [Mono-dev] [PATCH] ASP.NET - make FontUnit NOT use locale-
> > dependent decimal separator
> > 
> > Hello,
> > 
> >   The attached diff fixes the issue mentioned in the subject. Currently
> > mono will fail to parse font-size=0.Xem (etc) correctly if the current
> > thread culture is set to a locale that uses , as the decimal point
> > separator (e.g. de, pl). Please review, thanks
> This does not match the MS behavior. I've added a unit test to
> FontUnitTest.cs to verify this, and fixed FontUnit.ToString() to use the
> current locale.
Alas, this doesn't fix the problem. Please run xsp2 with the attached test file
- 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?



-------------- 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/20070212/6bb2591a/attachment.bin 

More information about the Mono-devel-list mailing list