LC_MESSAGES and BSD/OS

Started by Bruce Momjianover 25 years ago5 messages
#1Bruce Momjian
pgman@candle.pha.pa.us

Locale does not work on BSD/OS because it does not have LC_MESSAGES. I
just got this back from BSDI technical support. Comments?

---------------------------------------------------------------------------

In message <200006100115.VAA06505@candle.pha.pa.us>, Bruce Momjian writes:

I assume the symbol is supposed to be defined in locale.h. HP-UX and
other Unix's have this symbol, but BSDI doesn't. It is only used when
PostgreSQL is compile with locale enabled.

I see no mention of LC_MESSAGES in the include file or manual page.

LC_MESSAGES is apparently an extension; it's not in the POSIX spec, and it's
not in the C spec I have handy. (Admittedly, that's C99, but I don't think
anything like this was removed since C89.) So, recommend you #ifdef that;

#ifdef LC_MESSAGES
...[interact with LC_MESSAGES]
#endif

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#2Giles Lean
giles@nemeton.com.au
In reply to: Bruce Momjian (#1)
Re: LC_MESSAGES and BSD/OS

Locale does not work on BSD/OS because it does not have LC_MESSAGES. I
just got this back from BSDI technical support. Comments?

...

| LC_MESSAGES is apparently an extension; it's not in the POSIX spec, and it's
| not in the C spec I have handy. (Admittedly, that's C99, but I don't think
| anything like this was removed since C89.) So, recommend you #ifdef that;
|
| #ifdef LC_MESSAGES
| ...[interact with LC_MESSAGES]
| #endif

POSIX and ANSI C have the following categories:

LC_ALL
LC_COLLATE
LC_CTYPE
LC_MONETARY
LC_NUMERIC
LC_TIME

"Implementation defined additional categories" are allowed, and it
looks like many (most?) implementations use LC_MESSAGES, but they
don't have to, I guess.

Regards,

Giles

#3Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Giles Lean (#2)
Re: LC_MESSAGES and BSD/OS

OK, I am willing to make them #ifdef'ed, if someone would explain what
LC_MESSAGES is used for.

Locale does not work on BSD/OS because it does not have LC_MESSAGES. I
just got this back from BSDI technical support. Comments?

...

| LC_MESSAGES is apparently an extension; it's not in the POSIX spec, and it's
| not in the C spec I have handy. (Admittedly, that's C99, but I don't think
| anything like this was removed since C89.) So, recommend you #ifdef that;
|
| #ifdef LC_MESSAGES
| ...[interact with LC_MESSAGES]
| #endif

POSIX and ANSI C have the following categories:

LC_ALL
LC_COLLATE
LC_CTYPE
LC_MONETARY
LC_NUMERIC
LC_TIME

"Implementation defined additional categories" are allowed, and it
looks like many (most?) implementations use LC_MESSAGES, but they
don't have to, I guess.

Regards,

Giles

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: LC_MESSAGES and BSD/OS

Bruce Momjian <pgman@candle.pha.pa.us> writes:

OK, I am willing to make them #ifdef'ed, if someone would explain what
LC_MESSAGES is used for.

The HPUX locale man pages say:

LC_CTYPE determines the interpretation of text as single and/or
multi-byte characters, the classification of characters as printable,
and the characters matched by character class expressions in regular
expressions.

LC_COLLATE provides collation sequence definition
for relative ordering between collating elements (single- and
multi-character collating elements) in the locale.

LC_MESSAGES determines the locale that should be used to affect the
format and content of diagnostic messages written to standard error,
and informative messages written to standard output.

LC_MONETARY defines the rules and symbols used to
format monetary numeric information.

LC_NUMERIC defines rules and symbols used to format
non-monetary numeric information.

LC_TIME defines the rules for generating locale-specific formatted
date strings.

LC_ALL, when set to a non-empty string value, overrides the values of
all other internationalization variables.

Dunno which LC_foo variable corresponds to LC_MESSAGES on BSDI.

regards, tom lane

#5Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Tom Lane (#4)
Re: LC_MESSAGES and BSD/OS

OK, I have put #ifdef around the LC_MESSAGES to BSDI will work with
locale. Thanks.

Bruce Momjian <pgman@candle.pha.pa.us> writes:

OK, I am willing to make them #ifdef'ed, if someone would explain what
LC_MESSAGES is used for.

The HPUX locale man pages say:

LC_CTYPE determines the interpretation of text as single and/or
multi-byte characters, the classification of characters as printable,
and the characters matched by character class expressions in regular
expressions.

LC_COLLATE provides collation sequence definition
for relative ordering between collating elements (single- and
multi-character collating elements) in the locale.

LC_MESSAGES determines the locale that should be used to affect the
format and content of diagnostic messages written to standard error,
and informative messages written to standard output.

LC_MONETARY defines the rules and symbols used to
format monetary numeric information.

LC_NUMERIC defines rules and symbols used to format
non-monetary numeric information.

LC_TIME defines the rules for generating locale-specific formatted
date strings.

LC_ALL, when set to a non-empty string value, overrides the values of
all other internationalization variables.

Dunno which LC_foo variable corresponds to LC_MESSAGES on BSDI.

regards, tom lane

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026