Start of trail End of trail navigation bar

Table of Contents

stream_get_character_format

Returns the character format of the stream.

Syntax

[format, err] = stream_get_character_format(stream)
    

Description

Returns the character format used by the functions that send and receive characters. The result of this function may change after the first receive operation has been performed on the stream since the character format is determined automatically by default from the byte order mark, if present, at the beginning of the stream.

The FORMAT output will be one of the t_stream_format enumeration values:

STREAM_FORMAT_AUTO

= character format is determined from byte order mark (if present) read from the stream.

STREAM_FORMAT_UTF8

= using the Unicode UTF8 character set (8-bit Unicode)

STREAM_FORMAT_UTF16

= using the Unicode UTF16 character set (16-bit Unicode)

STREAM_FORMAT_UTF32

= using the Unicode UTF32 character set (32-bit Unicode)

STREAM_FORMAT_MULTIBYTE

= using a multibyte character set

This operation is not valid on listening streams created using stream_listen.

If no err output is provided then it throws an exception if an error occurs. In generated code it prints the error message. Use qc_get_error_message to get the message associated with an error code.

Parameters

stream

Stream handle returned by stream_connect or stream_accept.

Outputs

This function has no outputs.

Examples

fmt = stream_get_character_format(stream);    % Gets the character format of the specified stream.
    

See Also

 

navigation bar