Skip to contentSkip to conversation

setlocale.3: Wording issues

DISCUSSION Alejandro Colomar (man-pages) 3 participants 9 messages Jan 7, 2021 – Jan 9, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

Hi Michael,

I don't understand what this paragraph means, I think it needs some wfix.

Around setlocale.3:179:
[
On startup of the main program, the portable "C" locale is selected as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, by using the values returned from a localeconv(3) call for locale-dependent information, by using the multibyte and wide character functions for text processing if MB_CUR_MAX > 1, and by using strcoll(3), wc‐ scoll(3) or strxfrm(3), wcsxfrm(3) to compare strings.

<<<Especially these last 2 lines

]

Thanks,

Alex

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#1 lore raw

Hi Alex,

Quoted 18 lines · Alejandro Colomar (man-pages)

Hi Michael,

I don't understand what this paragraph means, I think it needs some wfix.

Around setlocale.3:179:
[
On startup of the main program, the portable "C" locale is selected as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, by using the values returned from a localeconv(3) call for locale-dependent information, by using the multibyte and wide character functions for text processing if MB_CUR_MAX > 1, and by using strcoll(3), wc‐ scoll(3) or strxfrm(3), wcsxfrm(3) to compare strings.

Quoted 3 lines

<<<Especially these last 2 lines

]

I see what you mean. I had to read that a few times to parse it. It looks like the text was added in 1999. I think the following clarifies and preserves the meaning:

[[
On startup of the main program, the portable "C" locale is select‐ ed as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, and then:

(a) using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

(c) using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1; and

(c) using strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3) to com‐ pare strings.
]]

What do you think?

Thanks,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#2 lore raw

Hi Michael,

Quoted 41 lines · Michael Kerrisk (man-pages)

Hi Alex,

Quoted 18 lines · Alejandro Colomar (man-pages)

Hi Michael,

I don't understand what this paragraph means, I think it needs some wfix.

Around setlocale.3:179:
[
On startup of the main program, the portable "C" locale is selected as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, by using the values returned from a localeconv(3) call for locale-dependent information, by using the multibyte and wide character functions for text processing if MB_CUR_MAX > 1, and by using strcoll(3), wc‐ scoll(3) or strxfrm(3), wcsxfrm(3) to compare strings.

Quoted 3 lines

<<<Especially these last 2 lines

]

I see what you mean. I had to read that a few times to parse it. It looks like the text was added in 1999. I think the following clarifies and preserves the meaning:

[[
On startup of the main program, the portable "C" locale is select‐ ed as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, and then:

(a) using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

Quoted 8 lines

(c) using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1; and

(c) using strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3) to com‐ pare strings.
]]

What do you think?

Much better.

But I still don't get why [A, B or C, D]. What does it mean?

Thanks,

Alex

Quoted 5 lines

Thanks,

Michael

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#3 lore raw
Quoted 51 lines · Alejandro Colomar (man-pages)

Hi Michael,

Quoted 48 lines · Michael Kerrisk (man-pages)

Hi Alex,

Quoted 18 lines · Alejandro Colomar (man-pages)

Hi Michael,

I don't understand what this paragraph means, I think it needs some wfix.

Around setlocale.3:179:
[
On startup of the main program, the portable "C" locale is selected as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, by using the values returned from a localeconv(3) call for locale-dependent information, by using the multibyte and wide character functions for text processing if MB_CUR_MAX > 1, and by using strcoll(3), wc‐ scoll(3) or strxfrm(3), wcsxfrm(3) to compare strings.

Quoted 3 lines

<<<Especially these last 2 lines

]

I see what you mean. I had to read that a few times to parse it. It looks like the text was added in 1999. I think the following clarifies and preserves the meaning:

[[
On startup of the main program, the portable "C" locale is select‐ ed as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, and then:

(a) using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

(c) using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1; and

(c) using strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3) to com‐ pare strings.
]]

Quoted 5 lines
Quoted 1 line

What do you think?

Much better.

But I still don't get why [A, B or C, D]. What does it mean?

I don't read it that way. I see it as: [A and (B and/or C and/or D]. Do you see what I mean?

Thanks,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#4 lore raw

Hi Michael,

Quoted 52 lines · Michael Kerrisk (man-pages)
Quoted 51 lines · Alejandro Colomar (man-pages)

Hi Michael,

Quoted 48 lines · Michael Kerrisk (man-pages)

Hi Alex,

Quoted 18 lines · Alejandro Colomar (man-pages)

Hi Michael,

I don't understand what this paragraph means, I think it needs some wfix.

Around setlocale.3:179:
[
On startup of the main program, the portable "C" locale is selected as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, by using the values returned from a localeconv(3) call for locale-dependent information, by using the multibyte and wide character functions for text processing if MB_CUR_MAX > 1, and by using strcoll(3), wc‐ scoll(3) or strxfrm(3), wcsxfrm(3) to compare strings.

Quoted 3 lines

<<<Especially these last 2 lines

]

I see what you mean. I had to read that a few times to parse it. It looks like the text was added in 1999. I think the following clarifies and preserves the meaning:

[[
On startup of the main program, the portable "C" locale is select‐ ed as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, and then:

(a) using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

(c) using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1; and

(c) using strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3) to com‐ pare strings.
]]

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

What do you think?

Much better.

But I still don't get why [A, B or C, D]. What does it mean?

I don't read it that way. I see it as: [A and (B and/or C and/or D]. Do you see what I mean?

About the three lines (a) (b) (c) as a whole, yes, I understand that part. About [strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3)], nope, I still can't understand the punctuation there.
So I can't parse the inner contents of (c).

Thanks,

Alex

Quoted 6 lines

Thanks,

Michael

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#5 lore raw

[CC += Bruno]

Hi Alex,

Quoted 61 lines · Alejandro Colomar (man-pages)

Hi Michael,

Quoted 58 lines · Michael Kerrisk (man-pages)
Quoted 56 lines · Alejandro Colomar (man-pages)

Hi Michael,

Quoted 41 lines · Michael Kerrisk (man-pages)

Hi Alex,

Quoted 18 lines · Alejandro Colomar (man-pages)

Hi Michael,

I don't understand what this paragraph means, I think it needs some wfix.

Around setlocale.3:179:
[
On startup of the main program, the portable "C" locale is selected as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, by using the values returned from a localeconv(3) call for locale-dependent information, by using the multibyte and wide character functions for text processing if MB_CUR_MAX > 1, and by using strcoll(3), wc‐ scoll(3) or strxfrm(3), wcsxfrm(3) to compare strings.

Quoted 3 lines

<<<Especially these last 2 lines

]

I see what you mean. I had to read that a few times to parse it. It looks like the text was added in 1999. I think the following clarifies and preserves the meaning:

[[
On startup of the main program, the portable "C" locale is select‐ ed as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, and then:

(a) using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

Quoted 8 lines

(c) using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1; and

(c) using strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3) to com‐ pare strings.
]]

What do you think?

Much better.

But I still don't get why [A, B or C, D]. What does it mean?

Quoted 7 lines
Quoted 2 lines

I don't read it that way. I see it as: [A and (B and/or C and/or D]. Do you see what I mean?

About the three lines (a) (b) (c) as a whole, yes, I understand that part. About [strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3)], nope, I still can't understand the punctuation there.
So I can't parse the inner contents of (c).

Ah sorry. Now I see what you mean. I'm not sure of this, but I suspect that it's supposed to mean:

Use [strcoll(3)+strxfrm(3)] for non-wide-char strings and [wcscoll(3)+wcsxfrm(3)] for wide char strings.

Maybe Bruno can help.

Thanks,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
#6 lore raw

Hi Michael,

Quoted 74 lines · Michael Kerrisk (man-pages)

[CC += Bruno]

Hi Alex,

Quoted 61 lines · Alejandro Colomar (man-pages)

Hi Michael,

Quoted 58 lines · Michael Kerrisk (man-pages)
Quoted 56 lines · Alejandro Colomar (man-pages)

Hi Michael,

Quoted 41 lines · Michael Kerrisk (man-pages)

Hi Alex,

Quoted 18 lines · Alejandro Colomar (man-pages)

Hi Michael,

I don't understand what this paragraph means, I think it needs some wfix.

Around setlocale.3:179:
[
On startup of the main program, the portable "C" locale is selected as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, by using the values returned from a localeconv(3) call for locale-dependent information, by using the multibyte and wide character functions for text processing if MB_CUR_MAX > 1, and by using strcoll(3), wc‐ scoll(3) or strxfrm(3), wcsxfrm(3) to compare strings.

Quoted 3 lines

<<<Especially these last 2 lines

]

I see what you mean. I had to read that a few times to parse it. It looks like the text was added in 1999. I think the following clarifies and preserves the meaning:

[[
On startup of the main program, the portable "C" locale is select‐ ed as default. A program may be made portable to all locales by calling:

setlocale(LC_ALL, "");

after program initialization, and then:

(a) using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

Quoted 8 lines

(c) using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1; and

(c) using strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3) to com‐ pare strings.
]]

What do you think?

Much better.

But I still don't get why [A, B or C, D]. What does it mean?

Quoted 7 lines
Quoted 2 lines

I don't read it that way. I see it as: [A and (B and/or C and/or D]. Do you see what I mean?

About the three lines (a) (b) (c) as a whole, yes, I understand that part. About [strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3)], nope, I still can't understand the punctuation there.
So I can't parse the inner contents of (c).

Quoted 7 lines

Ah sorry. Now I see what you mean. I'm not sure of this, but I suspect that it's supposed to mean:

Use [strcoll(3)+strxfrm(3)] for non-wide-char strings and [wcscoll(3)+wcsxfrm(3)] for wide char strings.

Maybe Bruno can help.

Yes, that was my first thought (after a few trials), but I preferred to check with you :)

I don't know how to express it.
Maybe [A and B, or C and D]?

Thanks,

Alex

Quoted 5 lines

Thanks,

Michael

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#7 lore raw
Quoted 8 lines · Alejandro Colomar (man-pages)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

(a) using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

(c) using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1; and

(c) using strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3) to com‐ pare strings.

If you feel it's better to separate the functions for strings from the functions for wide strings, I would write it like this:

* using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

* using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1;

* using strcoll(3) or strxfrm(3) to compare strings; and

* using wcscoll(3) or wcsxfrm(3) to compare wide-character strings.

Regarding the type of enumeration, I generally use
- (1), (2), (3), ... when the order matters, e.g. to describe steps that need to be done one after the other,
- (a), (b), (c), ... for alternatives ("or"),
- simple *, *, *, ... for other enumerations.

Bruno

#8 lore raw
Quoted 16 lines · Bruno Haible
Quoted 8 lines · Alejandro Colomar (man-pages)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

(a) using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

(c) using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1; and

(c) using strcoll(3), wcscoll(3) or strxfrm(3), wcsxfrm(3) to com‐ pare strings.

If you feel it's better to separate the functions for strings from the functions for wide strings, I would write it like this:

* using the values returned from a localeconv(3) call for lo‐ cale-dependent information;

Quoted 6 lines

* using the multibyte and wide character functions for text pro‐ cessing if MB_CUR_MAX > 1;

* using strcoll(3) or strxfrm(3) to compare strings; and

* using wcscoll(3) or wcsxfrm(3) to compare wide-character strings.

Thanks, Bruno!

Quoted 5 lines

Regarding the type of enumeration, I generally use
- (1), (2), (3), ... when the order matters, e.g. to describe steps that need to be done one after the other,
- (a), (b), (c), ... for alternatives ("or"),
- simple *, *, *, ... for other enumerations.

Agreed. I changed it.

Thanks,

Michael

Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/