Base WG Resolution Ref: bwg97-002
Topic: ISO C MSE Orientation


This is an approved Base Working Group Resolution for XSH Issue 5, XBD Issue 5.

Last update: 09 October,1997


								97 #002

 _____________________________________________________________________________

	Topic:			ISO C MSE Orientation
	Relevant Sections:	Multiple
	Spec:			XSH Issue 5, XBD Issue 5

Resolution Request:
-------------------
The current wording of XSH5/XBD is not aligned with the 
the orientation model described in the  ISO C MSE rationale.

Resolution Response
-------------------

The following set of changes have been identified to XBD5 and
XSH5 and will be applied in a future revision . For this
revision of the specification either behaviour is deemed 
conforming.


1. XBD Changes

M1.	

Add to XBD5, P8 after the glossary entry for "byte":
	byte input/output functions
	The functions that perform byte-oriented input from streams
	or byte-oriented output to streams: fgetc(), fgets(),
	fprintf(), fputc(), fputs(), fread(), fscanf(), fwrite(),
	getc(), getchar(), gets(), printf(), putc(), putchar(), puts(),
	scanf(), ungetc(), vfprintf(), and vprintf().

M2.

Add to XBD5, P13 after the glossary entry for "empty string":
	encoding rule
	The rules used to convert between wide-character codes and
	multibyte-character codes.  See the XSH specification, Section
	2.4.2, Stream Orientation.

M3.

Add to XBD5, P21 after the glossary entry for "option-argument":
	orientation
	A stream has one of three orientations: unoriented,
	byte-oriented, or wide-oriented.  See the XSH specification,
	Section 2.4.2, Stream Orientation.

M4.

Add to XBD5, P36, after the glossary entry for "wide-character code (C
language":
	wide-character input/output functions
	The functions that perform wide-oriented input from streams or
	wide-oriented output to streams: fgetwc(), fputwc(), fputws(),
	fwprintf(), fwscanf(), getwc(), getwchar(), getws(), putwc(),
	putwchar(), ungetwc(), vfwprintf(), vwprintf(), wprintf(), and
	wscanf().

2. XSH Changes

M5.

Change the title of XSH5, section 2.4.2 from "Stream Orientation" to
"Stream Orientation and Encoding Rules".  Update all references to "XSH
Section 2.4.2, Stream Orientation" in XBD5, XCU5, and in this
resolution and all references to "Section 2.4.2, Stream Orientation" in
XSH5 and in this resolution.

M6.

Add a new paragraph in XSH5 section 2.4.2, P32 after the paragraph that
begins with "Each wide-oriented stream...":
	Implementations that support multiple encoding rules associate
	an encoding rule with the stream.  The encoding rule is
	determined by the setting of the LC_CTYPE category in the
	current locale at the time when the stream becomes
	wide-oriented.  If a wide-character input/output function is
	applied to a byte-oriented stream, the encoding rule used is
	undefined.  As with the stream's orientation, the encoding rule
	associated with a stream cannot be changed once it has been
	set, except by a successful call to freopen() which clears the
	encoding rule and resets the orientation to unoriented.

M6.5

Change the two paragraphs in XSH5 section 2.4.2, P33 from:
	The wide-character input functions read characters from the
	stream and convert them to wide-characters as if they were read
	by successive calls to the fgetwc() function.  Each conversion
	occurs as if by a call to the mbrtowc() function, with the
	conversion state described by the stream's own mbstate_t
	object.

	The wide-character output functions convert wide-characters to
	(possibly multibyte) characters and write them to the stream as
	if they were written by successive calls to the fputwc()
	function.  Each conversion occurs as if by a a call to the
	wcrtomb() function, with the coversion state described by the
	stream's own mbstate_t object.
to:
	The wide-character input functions read characters from the
	stream and convert them to wide-characters as if they were read
	by successive calls to the fgetwc() function.  Each conversion
	occurs as if by a call to the mbrtowc() function with the
	conversion state described by the stream's own mbstate_t
	object, except the encoding rule associated with the stream is
	used instead of the encoding rule implied by the LC_CTYPE
	category of the current locale.

	The wide-character output functions convert wide-characters to
	(possibly multibyte) characters and write them to the stream as
	if they were written by successive calls to the fputwc()
	function.  Each conversion occurs as if by a a call to the
	wcrtomb() function with the coversion state described by the
	stream's own mbstate_t object, except the encoding rule
	associated with the stream is used instead of the encoding rule
	implied by the LC_CTYPE category of the current locale.
with the "except ..." clauses in both of these paragraphs shaded with
EX markings.
	
M7.

Add a new paragraph before the last paragraph of the fopen() description
on XSH5, P246:
	After a successful call to the fopen() function, the
	orientation of the stream is cleared, the encoding rule is
	cleared, and the associated mbstate_t object is set to describe
	an initial conversion state.
with "the encoding rule is cleared" shaded with an EX marking.

M8.

Change the fourth paragraph of the freopen() description on XSH5, P270
from:
	After a successful call to the freopen() function, the
	orientation of the stream is cleared and the associated
	mbstate_t object is set to describe an initial conversion
	state.
to:
	After a successful call to the freopen() function, the
	orientation of the stream is cleared, the encoding rule is
	cleared, and the associated mbstate_t object is set to describe
	an initial conversion state.
with "the encoding rule is cleared" shaded with an EX marking.

M9.
   (empty)

M10.	 (editorial)

Shade the last paragraph of the mbrlen() description on XSH5, P496:
	The behavior of this function is affected by the LC_CTYPE
	category of the current locale.
with an EX marking.

M11.	(empty)

M12. (editorial)

Shade the last paragraph of the mbrtowc() description on XSH5, P498:
	The behavior of this function is affected by the LC_CTYPE
	category of the current locale.
with an EX marking.

M13.	(empty)

M14.	(empty)

M14.5.  (Editorial correction.)
Shade the last paragraph of the mbsrtowcs() description on XSH5, P501:
        The behavior of this function is affected by the LC_CTYPE
        category of the current locale.
with an EX marking.

M15.	(empty)

M16.	(editorial.)

Shade the last paragraph of the wcrtomb() description on XSH5, P1009:
	The behavior of this function is affected by the LC_CTYPE
	category of the current locale.
with an EX marking.

M17.	(empty)

M18.	(editorial)

Shade the last paragraph of the wcsrtombs() description on XSH5, P1023:
	The behavior of this function is affected by the LC_CTYPE
	category of the current locale.
with an EX marking.

Rationale
-------------
None.

Circulated for review: Jun 25 1997
Proposed for final review: Sep 18 1997
Approved: Sep 30 1997