SmartSockets .NET Class Library

Tut.convertUcs2ToUtf8Ex Method 

Converts a Unicode string to a null-terminated, UTF-8 encoded, array of bytes.

Note that this encoding is not the same as the default writeUTF and readUTF encoding, which is a length, data encoding. Our encoding is fully compatible with standard C ASCII strings so long as only ASCII is used. The default encoding is not only incompatible with this, but requires knowledge of the endian to swap the two-byte length.

This method returns an instance of a TipcUtf8Buffer class which increases the performance. Instead of copying a the buffer, an instance of the TipcUtf8Buffer class is returned, which contains the buffer and the offset and length of the UTF8 data.

public static TipcUtf8Buffer convertUcs2ToUtf8Ex(
   string s
);

Parameters

s
the Unicode string to convert.

Return Value

the UTF-8 encoded byte array.

See Also

Tut Class | Tut Members | TIBCO.SMARTSOCKETS Namespace


Copyright © TIBCO Software Inc. All rights reserved