This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Proposal for new element(s) in LC_CTYPE


Hello

This mail describes the Persian requirements in glibc and my proposals
for them.

Actually, our problem were discussed here and there frequently, but I
explain it in short again: 

Persian widely uses two separated numeric forms: Persian (with its own
digits and own decimal point) and English (with its POSIX digits).
defining decimal point in LC_NUMERIC make us to see decimal point in
Persian in both English and Persian forms. Which actually doesn't
correct. We want Persian numbers with Persian decimal point and English
ones with POSIX decimal point.

The same problem happens for thousands-sep and maybe some other elements
in LC_MONETARY too.

My Solutions:
We are going to implement one of these methods:

First, Defining necessary elements:

Our first idea was to define these two elements in LC_CTYPE:
1. out_decimal_point
2. out_thousands_sep
Except them we may also need some other elements in other categories
like : out_mon_decimal_point, out_mon_thousands_sep in LC_MONATERY and
some other things for LC_TIME.

Second, Defining one main element:

We add one new element like "posix_compliance". This element accept a
string of some specific characters like 'd' for decimal_point or 't' for
thousands-sep. 
Now, when one sets some of these characters to "posix_compliance" for
its locale, he/she would see those specific elements in POSIX format.
There is one exception here: By put '%I' flag for numbers,
"posix_compliance" lose its meaning for that number, and we see that
number in locale format.
example: 
  in locale file:
    posix_compliance "dt"

  And in a sample program:

    printf("%f\n", 12.34);  
/* which shows the number in POSIX format with POSIX decimal_point */

    printf("%If\n", 12.34); 
/* which shows the number in locale format with locale decimal_point */

Some Advantages:

* Reduce the number of none-standard elements in LC_*
* posix_compliance is flexible: we can add new elements to it. Also '%I'
  would have more usage for other elements too.
* We don't anymore have to change our main decimal_point to '.'
* Useful for other languages to have POSIX elements beside their locale 
  ones. This also increase the usage of 'I' flag in other languages.


Finally,
Behdad in his proposal for this problem suggested using "%Id" as
default. It seems also correct if we use iswdigit(). What you think?

Ulrich:
1. Which one of these ways is more suitable?
2. Do you agree with our suggested names?


-- 
Hamed Malek <hamed@bamdad.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]