Bug 49 - font-config can't parse data files in the fa_IR locale
Summary: font-config can't parse data files in the fa_IR locale
Status: RESOLVED FIXED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.0
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Keith Packard
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-19 09:43 UTC by Daniel Stone
Modified: 2003-03-18 23:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description FreeDesktop Bugzilla Database Corruption Fix User 2003-03-19 09:43:42 UTC
Under Red Hat 8.0, I get the following error when I run almost any GNOME
application under the fa_IR locale (say, 'LANG=fa_IR gnotski').

/usr/share/themes/Bluecurve/gtk-2.0/gtkrc:89: error: scanner: digit is beyond radix
Fontconfig error: line 263: ".2": not a valid double
Fontconfig error: line 265: wrong number of matrix elements
Fontconfig error: Cannot load default config file

This is possibly due to the fact that fa_IR needs another decimal separator than
the '.' or ','. fontconfig needs to be able to parse the config file regardless
of the locale, possibly in the C locale.
Comment 1 Keith Packard 2003-03-19 18:01:16 UTC
It appears the problem is in glibc when parsing floating point numbers in a
non-ascii locale which have no number to the left of the decimal point.  The
ISO/IEC 1999 C standard specifies that arguments to strtod start with a
non-empty sequence of digits, so it appears that glibc is in compliance with the
spec.  The problem is that in the C local, strtod doesn't require leading digits.

Examples of numbers which appear to fail are .5 and -.5

I also examind the FreeBSD strtod source to discover that it doesn't correctly
handle locales which use more than one byte for the decimal point character.

I suggest that we rewrite the configuration files to match the format required
by the ISO/IEC C standard instead of attempting to kludge around things by
half-parsing the floating point number.  I've applied appropriate patches to CVS
for fonts.conf.in


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.