quanser.communications.stream.get_character_format quanser.communications.stream.set_byte_order navigation bar

Table of Contents

quanser.communications.stream.set_character_format

Sets the character format of the stream.

Syntax

stream.set_character_format(format)
stream.set_character_format          % Use 'auto' format
    

Description

Determines whether the functions that send and receive characters use Unicode UTF8, UTF16 or UTF32 or determine the character format automatically from the first characters read from the stream.

The FORMAT argument may be one of the following values:

'auto'

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

'ascii'

= use the Unicode UTF8 character set (8-bit Unicode) since it is equivalent to ASCII for the first 127 (0x7f) characters

'unicode'

= use the Unicode character set native to the operating system. For example, on Windows it will be UTF16 but on Linux it will be UTF8

'utf8'

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

'utf16'

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

'utf32'

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

'multibyte'

= use a multibyte character set (based on current locale and code page)

This operation is not valid on listening streams created using quanser.communications.stream.listen.

Parameters

stream

Stream handle returned by quanser.communications.stream.connect or accept.

format

A string indicating the character format to use. See the Description above for details. If this argument is omitted then it defaults to 'auto'.

Outputs

This function has no outputs.

Examples

stream.set_character_format('utf8');    % Sets the character format of the specified stream to UTF-8.
    

See Also

 

navigation bar