View Issue Details

IDProjectCategoryView StatusLast Update
0019675FPCRTLpublic2011-07-04 09:47
ReporterLudo BrandsAssigned ToMarco van de Voort 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Platformx86OSSolarisOS Version10
Product Version2.5.1Product Buildsvn 17910 
Target VersionFixed in Version 
Summary0019675: [PATCH] Wrong definitions in clocale.inc causes EconvertError 'Illegal character in format string'
DescriptionGetFormatSettings sets wrong values in DefaultFormatSettings. ShortDateFormat becomes 'Monday' and causes above error in DateToStr.

Attached patch contains defines from /usr/include/iso/locale_iso.h and /usr/include/langinfo.h. Corrected also lconv structure.
TagsNo tags attached.
Fixed in Revision 17919
FPCOldBugId
FPCTarget
Attached Files
  • solaris-clocale.diff (6,917 bytes)
    Index: clocale.inc
    ===================================================================
    --- clocale.inc	(revision 17911)
    +++ clocale.inc	(working copy)
    @@ -16,22 +16,24 @@
       Crosschecked with OS X 10.4/ppc headers.
       To some symbols leading underscores were added. If these values are
        ever exposed in an interface this has to be reevaluated.
    +  Updated by Ludo Brands from Solaris 10 headers files.
     }
     
     {$IFDEF FPC}
     {$PACKRECORDS C}
     {$ENDIF}
     
    -  __LC_ALL          = 0;
    -  __LC_COLLATE      = 1;
    -  __LC_CTYPE        = 2;
    -  __LC_MONETARY     = 3;
    -  __LC_NUMERIC      = 4;
    -  __LC_TIME         = 5;
    -  __LC_MESSAGES     = 6;
    -  _LC_LAST         = 7;              { marks end }
     
    +// from /usr/include/iso/locale_iso.h
    +      __LC_CTYPE    = 0;
    +      __LC_NUMERIC  = 1;
    +      __LC_TIME     = 2;
    +      __LC_COLLATE  = 3;
    +      __LC_MONETARY = 4;
    +      __LC_MESSAGES = 5;
    +      __LC_ALL      = 6;
     
    +
     Type
          lconv = record
               decimal_point     : pchar;
    @@ -53,8 +55,8 @@
               p_sign_posn       : char;
               n_sign_posn       : char;
               int_p_cs_precedes : char;
    +          int_p_sep_by_space: char;
               int_n_cs_precedes : char;
    -          int_p_sep_by_space: char;
               int_n_sep_by_space: char;
               int_p_sign_posn   : char;
               int_n_sign_posn   : char;
    @@ -62,74 +64,150 @@
          Tlconv = lconv;
          plconv = ^lconv;
     
    +// imported from /usr/include/langinfo.h
    +
     Const
    -        CODESET         = 0;     { codeset name }
    -        D_T_FMT         = 1;     { string for formatting date and time }
    -        D_FMT           = 2;     { date format string }
    -        T_FMT           = 3;     { time format string }
    -        T_FMT_AMPM      = 4;     { a.m. or p.m. time formatting string }
    -        AM_STR          = 5;     { Ante Meridian affix }
    -        PM_STR          = 6;     { Post Meridian affix }
    +  {
    +   * The seven days of the week in their full beauty
    +    }
    +  { sunday  }
    +    DAY_1 = 1;
    +  { monday  }
    +    DAY_2 = 2;
    +  { tuesday  }
    +    DAY_3 = 3;
    +  { wednesday  }
    +    DAY_4 = 4;
    +  { thursday  }
    +    DAY_5 = 5;
    +  { friday  }
    +    DAY_6 = 6;
    +  { saturday  }
    +    DAY_7 = 7;
    +  {
    +   * The abbreviated seven days of the week
    +    }
    +  { sun  }
    +    ABDAY_1 = 8;
    +  { mon  }
    +    ABDAY_2 = 9;
    +  { tue  }
    +    ABDAY_3 = 10;
    +  { wed  }
    +    ABDAY_4 = 11;
    +  { thu  }
    +    ABDAY_5 = 12;
    +  { fri  }
    +    ABDAY_6 = 13;
    +  { sat  }
    +    ABDAY_7 = 14;
    +  {
    +   * The full names of the twelve months...
    +    }
    +  { january  }
    +    MON_1 = 15;
    +  { february  }
    +    MON_2 = 16;
    +  { march  }
    +    MON_3 = 17;
    +  { april  }
    +    MON_4 = 18;
    +  { may  }
    +    MON_5 = 19;
    +  { june  }
    +    MON_6 = 20;
    +  { july  }
    +    MON_7 = 21;
    +  { august  }
    +    MON_8 = 22;
    +  { september  }
    +    MON_9 = 23;
    +  { october  }
    +    MON_10 = 24;
    +  { november  }
    +    MON_11 = 25;
    +  { december  }
    +    MON_12 = 26;
    +  {
    +   * ... and their abbreviated form
    +    }
    +  { jan  }
    +    ABMON_1 = 27;
    +  { feb  }
    +    ABMON_2 = 28;
    +  { mar  }
    +    ABMON_3 = 29;
    +  { apr  }
    +    ABMON_4 = 30;
    +  { may  }
    +    ABMON_5 = 31;
    +  { jun  }
    +    ABMON_6 = 32;
    +  { jul  }
    +    ABMON_7 = 33;
    +  { aug  }
    +    ABMON_8 = 34;
    +  { sep  }
    +    ABMON_9 = 35;
    +  { oct  }
    +    ABMON_10 = 36;
    +  { nov  }
    +    ABMON_11 = 37;
    +  { dec  }
    +    ABMON_12 = 38;
    +  {
    +   * plus some special strings you might need to know
    +    }
    +  { radix character  }
    +    RADIXCHAR = 39;
    +  { separator for thousand  }
    +    THOUSEP = 40;
    +  { YESSTR and NOSTR marked as legacy in XPG5 and removed in SUSv3  }
    +  { affirmative response for yes/no queries  }
     
    -{ week day names }
    -        DAY_1           = 7;
    -        DAY_2           = 8;
    -        DAY_3           = 9;
    -        DAY_4           = 10;
    -        DAY_5           = 11;
    -        DAY_6           = 12;
    -        DAY_7           = 13;
    +    YESSTR = 41;
    +  { negative response for yes/no queries  }
    +    NOSTR = 42;
    +  { !defined(_XPG6) || defined(__EXTENSIONS__  }
    +  { currency symbol  }
     
    -{ abbreviated week day names }
    -        ABDAY_1         = 14;
    -        ABDAY_2         = 15;
    -        ABDAY_3         = 16;
    -        ABDAY_4         = 17;
    -        ABDAY_5         = 18;
    -        ABDAY_6         = 19;
    -        ABDAY_7         = 20;
    +    CRNCYSTR = 43;
    +  {
    +   * Default string used to format date and time
    +   *	e.g. Sunday, August 24 21:08:38 MET 1986
    +    }
    +  { string for formatting date and time  }
    +    D_T_FMT = 44;
    +  { date format  }
    +    D_FMT = 45;
    +  { time format  }
    +    T_FMT = 46;
    +  { am string  }
    +    AM_STR = 47;
    +  { pm string  }
    +    PM_STR = 48;
    +  {
    +   * Additions for XPG4 (XSH4) Compliance
    +    }
    +  { codeset name  }
    +    CODESET = 49;
    +  { am or pm time format string  }
    +    T_FMT_AMPM = 50;
    +  { era description segments  }
    +    ERA = 51;
    +  { era date format string  }
    +    ERA_D_FMT = 52;
    +  { era date and time format string  }
    +    ERA_D_T_FMT = 53;
    +  { era time format string  }
    +    ERA_T_FMT = 54;
    +  { alternative symbols for digits  }
    +    ALT_DIGITS = 55;
    +  { affirmative response expression  }
    +    YESEXPR = 56;
    +  { negative response expression  }
    +    NOEXPR = 57;
    +  { strftime format for date(1)  }
    +    _DATE_FMT = 58;
     
    -{ month names }
    -        MON_1           = 21;
    -        MON_2           = 22;
    -        MON_3           = 23;
    -        MON_4           = 24;
    -        MON_5           = 25;
    -        MON_6           = 26;
    -        MON_7           = 27;
    -        MON_8           = 28;
    -        MON_9           = 29;
    -        MON_10          = 30;
    -        MON_11          = 31;
    -        MON_12          = 32;
    -
    -{ abbreviated month names }
    -        ABMON_1         = 33;
    -        ABMON_2         = 34;
    -        ABMON_3         = 35;
    -        ABMON_4         = 36;
    -        ABMON_5         = 37;
    -        ABMON_6         = 38;
    -        ABMON_7         = 39;
    -        ABMON_8         = 40;
    -        ABMON_9         = 41;
    -        ABMON_10        = 42;
    -        ABMON_11        = 43;
    -        ABMON_12        = 44;
    -
    -        ERA             = 45;      { era description segments }
    -        ERA_D_FMT       = 46;      { era date format string }
    -        ERA_D_T_FMT     = 47;      { era date and time format string }
    -        ERA_T_FMT       = 48;      { era time format string }
    -        ALT_DIGITS      = 49;      { alternative symbols for digits }
    -        RADIXCHAR       = 50;      { radix char }
    -        THOUSEP         = 51;      { separator for thousands }
    -
    -        YESEXPR         = 52;      { affirmative response expression }
    -        NOEXPR          = 53;      { negative response expression }
    -        YESSTR          = 54;      { affirmative response for yes/no queries }
    -        NOSTR           = 55;      { negative response for yes/no queries }
    -        CRNCYSTR        = 56;      { currency symbol }
    -        D_MD_ORDER      = 57;      { month/day order (local extension) }
    -
     function localeconv:plconv; cdecl; external clib name 'localeconv';
    
    solaris-clocale.diff (6,917 bytes)

Activities

2011-07-03 16:01

 

solaris-clocale.diff (6,917 bytes)
Index: clocale.inc
===================================================================
--- clocale.inc	(revision 17911)
+++ clocale.inc	(working copy)
@@ -16,22 +16,24 @@
   Crosschecked with OS X 10.4/ppc headers.
   To some symbols leading underscores were added. If these values are
    ever exposed in an interface this has to be reevaluated.
+  Updated by Ludo Brands from Solaris 10 headers files.
 }
 
 {$IFDEF FPC}
 {$PACKRECORDS C}
 {$ENDIF}
 
-  __LC_ALL          = 0;
-  __LC_COLLATE      = 1;
-  __LC_CTYPE        = 2;
-  __LC_MONETARY     = 3;
-  __LC_NUMERIC      = 4;
-  __LC_TIME         = 5;
-  __LC_MESSAGES     = 6;
-  _LC_LAST         = 7;              { marks end }
 
+// from /usr/include/iso/locale_iso.h
+      __LC_CTYPE    = 0;
+      __LC_NUMERIC  = 1;
+      __LC_TIME     = 2;
+      __LC_COLLATE  = 3;
+      __LC_MONETARY = 4;
+      __LC_MESSAGES = 5;
+      __LC_ALL      = 6;
 
+
 Type
      lconv = record
           decimal_point     : pchar;
@@ -53,8 +55,8 @@
           p_sign_posn       : char;
           n_sign_posn       : char;
           int_p_cs_precedes : char;
+          int_p_sep_by_space: char;
           int_n_cs_precedes : char;
-          int_p_sep_by_space: char;
           int_n_sep_by_space: char;
           int_p_sign_posn   : char;
           int_n_sign_posn   : char;
@@ -62,74 +64,150 @@
      Tlconv = lconv;
      plconv = ^lconv;
 
+// imported from /usr/include/langinfo.h
+
 Const
-        CODESET         = 0;     { codeset name }
-        D_T_FMT         = 1;     { string for formatting date and time }
-        D_FMT           = 2;     { date format string }
-        T_FMT           = 3;     { time format string }
-        T_FMT_AMPM      = 4;     { a.m. or p.m. time formatting string }
-        AM_STR          = 5;     { Ante Meridian affix }
-        PM_STR          = 6;     { Post Meridian affix }
+  {
+   * The seven days of the week in their full beauty
+    }
+  { sunday  }
+    DAY_1 = 1;
+  { monday  }
+    DAY_2 = 2;
+  { tuesday  }
+    DAY_3 = 3;
+  { wednesday  }
+    DAY_4 = 4;
+  { thursday  }
+    DAY_5 = 5;
+  { friday  }
+    DAY_6 = 6;
+  { saturday  }
+    DAY_7 = 7;
+  {
+   * The abbreviated seven days of the week
+    }
+  { sun  }
+    ABDAY_1 = 8;
+  { mon  }
+    ABDAY_2 = 9;
+  { tue  }
+    ABDAY_3 = 10;
+  { wed  }
+    ABDAY_4 = 11;
+  { thu  }
+    ABDAY_5 = 12;
+  { fri  }
+    ABDAY_6 = 13;
+  { sat  }
+    ABDAY_7 = 14;
+  {
+   * The full names of the twelve months...
+    }
+  { january  }
+    MON_1 = 15;
+  { february  }
+    MON_2 = 16;
+  { march  }
+    MON_3 = 17;
+  { april  }
+    MON_4 = 18;
+  { may  }
+    MON_5 = 19;
+  { june  }
+    MON_6 = 20;
+  { july  }
+    MON_7 = 21;
+  { august  }
+    MON_8 = 22;
+  { september  }
+    MON_9 = 23;
+  { october  }
+    MON_10 = 24;
+  { november  }
+    MON_11 = 25;
+  { december  }
+    MON_12 = 26;
+  {
+   * ... and their abbreviated form
+    }
+  { jan  }
+    ABMON_1 = 27;
+  { feb  }
+    ABMON_2 = 28;
+  { mar  }
+    ABMON_3 = 29;
+  { apr  }
+    ABMON_4 = 30;
+  { may  }
+    ABMON_5 = 31;
+  { jun  }
+    ABMON_6 = 32;
+  { jul  }
+    ABMON_7 = 33;
+  { aug  }
+    ABMON_8 = 34;
+  { sep  }
+    ABMON_9 = 35;
+  { oct  }
+    ABMON_10 = 36;
+  { nov  }
+    ABMON_11 = 37;
+  { dec  }
+    ABMON_12 = 38;
+  {
+   * plus some special strings you might need to know
+    }
+  { radix character  }
+    RADIXCHAR = 39;
+  { separator for thousand  }
+    THOUSEP = 40;
+  { YESSTR and NOSTR marked as legacy in XPG5 and removed in SUSv3  }
+  { affirmative response for yes/no queries  }
 
-{ week day names }
-        DAY_1           = 7;
-        DAY_2           = 8;
-        DAY_3           = 9;
-        DAY_4           = 10;
-        DAY_5           = 11;
-        DAY_6           = 12;
-        DAY_7           = 13;
+    YESSTR = 41;
+  { negative response for yes/no queries  }
+    NOSTR = 42;
+  { !defined(_XPG6) || defined(__EXTENSIONS__  }
+  { currency symbol  }
 
-{ abbreviated week day names }
-        ABDAY_1         = 14;
-        ABDAY_2         = 15;
-        ABDAY_3         = 16;
-        ABDAY_4         = 17;
-        ABDAY_5         = 18;
-        ABDAY_6         = 19;
-        ABDAY_7         = 20;
+    CRNCYSTR = 43;
+  {
+   * Default string used to format date and time
+   *	e.g. Sunday, August 24 21:08:38 MET 1986
+    }
+  { string for formatting date and time  }
+    D_T_FMT = 44;
+  { date format  }
+    D_FMT = 45;
+  { time format  }
+    T_FMT = 46;
+  { am string  }
+    AM_STR = 47;
+  { pm string  }
+    PM_STR = 48;
+  {
+   * Additions for XPG4 (XSH4) Compliance
+    }
+  { codeset name  }
+    CODESET = 49;
+  { am or pm time format string  }
+    T_FMT_AMPM = 50;
+  { era description segments  }
+    ERA = 51;
+  { era date format string  }
+    ERA_D_FMT = 52;
+  { era date and time format string  }
+    ERA_D_T_FMT = 53;
+  { era time format string  }
+    ERA_T_FMT = 54;
+  { alternative symbols for digits  }
+    ALT_DIGITS = 55;
+  { affirmative response expression  }
+    YESEXPR = 56;
+  { negative response expression  }
+    NOEXPR = 57;
+  { strftime format for date(1)  }
+    _DATE_FMT = 58;
 
-{ month names }
-        MON_1           = 21;
-        MON_2           = 22;
-        MON_3           = 23;
-        MON_4           = 24;
-        MON_5           = 25;
-        MON_6           = 26;
-        MON_7           = 27;
-        MON_8           = 28;
-        MON_9           = 29;
-        MON_10          = 30;
-        MON_11          = 31;
-        MON_12          = 32;
-
-{ abbreviated month names }
-        ABMON_1         = 33;
-        ABMON_2         = 34;
-        ABMON_3         = 35;
-        ABMON_4         = 36;
-        ABMON_5         = 37;
-        ABMON_6         = 38;
-        ABMON_7         = 39;
-        ABMON_8         = 40;
-        ABMON_9         = 41;
-        ABMON_10        = 42;
-        ABMON_11        = 43;
-        ABMON_12        = 44;
-
-        ERA             = 45;      { era description segments }
-        ERA_D_FMT       = 46;      { era date format string }
-        ERA_D_T_FMT     = 47;      { era date and time format string }
-        ERA_T_FMT       = 48;      { era time format string }
-        ALT_DIGITS      = 49;      { alternative symbols for digits }
-        RADIXCHAR       = 50;      { radix char }
-        THOUSEP         = 51;      { separator for thousands }
-
-        YESEXPR         = 52;      { affirmative response expression }
-        NOEXPR          = 53;      { negative response expression }
-        YESSTR          = 54;      { affirmative response for yes/no queries }
-        NOSTR           = 55;      { negative response for yes/no queries }
-        CRNCYSTR        = 56;      { currency symbol }
-        D_MD_ORDER      = 57;      { month/day order (local extension) }
-
 function localeconv:plconv; cdecl; external clib name 'localeconv';
solaris-clocale.diff (6,917 bytes)

Marco van de Voort

2011-07-03 20:05

manager   ~0049624

Committed, thanks.

Issue History

Date Modified Username Field Change
2011-07-03 16:01 Ludo Brands New Issue
2011-07-03 16:01 Ludo Brands File Added: solaris-clocale.diff
2011-07-03 20:05 Marco van de Voort Fixed in Revision => 17919
2011-07-03 20:05 Marco van de Voort Status new => resolved
2011-07-03 20:05 Marco van de Voort Resolution open => fixed
2011-07-03 20:05 Marco van de Voort Assigned To => Marco van de Voort
2011-07-03 20:05 Marco van de Voort Note Added: 0049624
2011-07-04 09:47 Ludo Brands Status resolved => closed