Eclipse behavior for
Function OPEN
Description:
The following external-format designators are supported:
Character Formats:
:ASCII upgrades the stream
element-type to base-char.
:UCS upgrades the stream
element-type to ucs-2-char if the specified
element-type is a subtype of ucs-2-char.
Otherwise, element-type is upgraded to
unicode-char.
:MULTI-BYTE upgrades the stream
element-type to ucs-2-char or
unicode-char, depending on the support provided by the
operating system.
wcstombs() utility. Whether this
accomplishes the right thing depends on the operating system's notion
of locale and whether the result
is viewed on a device that respects the operating system's notion of
locale. See Character Predicates and Case, in "Character in Eclipse".
mbstowcs() utility.
Integer formats:
:BIG-ENDIAN. Integers are output with the most
significant "byte" (8-bit octet) appearing first in the
stream.
:LITTLE-ENDIAN. Integers are output with the most
significant "byte" (8-bit octet) appearing last in the
stream.
When the :DEFAULT external-format is specified,
the actual external-format used is based on the specified
element-type, and can be examined with
stream-external-format. The value is :ASCII
when element-type is a subtype of base-char,
:MULTI-BYTE when element-type is a subtype of
unicode-char, and :BIG-ENDIAN when
element-type is a subtype of integer.
When the :DEFAULT element-type is specified, the
actual element-type used is based on the actual
external-format, and can be examined with
stream-element-type. The value will be the most restricted
element-type listed above, for the given external-format.
See Also:
"Characters in Eclipse" (particularly the "Interaction With Streams" section), *default-element-type*, stream-element-type, stream-external-format.
Notes:
unicode-char is a strict subtype of character in Eclipse. However, no behavior is currently defined for any character that is not also a unicode-char. Accordingly, open will treat character element-type arguments as though they were specified as unicode-char. This may change in future releases, and programmers are encouraged to specify the precise value of element-type required. The actual stream-element-type reflects the correctly downgraded value.
:MULTI-BYTE and :ASCII formats are the
same externally when the default (i.e. the "C") locale is used and only ASCII
characters are involved.
:MULTI-BYTE is also known as :UTS-8.
On some platforms, the operating system implementation of
wcstombs() and mbstowcs() does not correctly
handle 4 octet unicode characters (UCS-4). On these platforms, the
actual stream-element-type for :MULTI-BYTE streams
may be downgraded to ucs-2-char.
The units of position used in file-position,
file-length, and file-string-length are 8-bit bytes for
the :MULTI-BYTE external-format. For all other
external-formats, the units of position measure one
element-type.