Defect Report #024

Submission Date: 10 Dec 92
Submittor: WG14
Source: X3J11/91-004 (Fred Tydeman)
Question 1
In subclause 7.10.1.4 The strtod function page 151, line 5: What does ``"C" locale'' mean?

  1. setlocale(LC_ALL,NULL) == "C"
  2. setlocale(LC_NUMERIC,NULL) == "C"
  3. &&
  4. ||
  5. something else.
What does ``other than the "C" locale'' mean?
  1. setlocale(LC_ALL,NULL) != "C"
  2. setlocale(LC_NUMERIC,NULL) != "Ct
  3. &&
  4. ||
  5. something else.
Subclause 7.4.1 Locale control, page 107 may help answer the questions.
Response
Subclause 7.4.1.1, page 107, lines 11-17 describe what is affected by each locale portion.
Is it the LC_NUMERIC locale category which affects the implementation-defined behavior of strtod, etc.?
Answer: Yes.
How can one guarantee that strtod functions are in the "C" locale?
Answer: Execute setlocale(LC_NUMERIC, "C") or execute setlocale(LC_ALL, "C") .
What is meant by ``other than the "C" locale?'' That is, how can one ensure that strtod is not in the "C" locale?

Answer: Successfully execute setlocale(LC_NUMERIC, str) or setlocale(LC_ALL, str) to some implementation-defined string str which specifies a locale that is different from the "C" locale. No universally portable method can be provided, because the functionality is implementation-defined.
Previous Defect Report < - > Next Defect Report