Carbon


ConvertFromPStringToUnicode

Header: UnicodeConverter.h Carbon status: Supported

Converts a Pascal string in a Mac OS text encoding to a Unicode string.

OSStatus ConvertFromPStringToUnicode (
    TextToUnicodeInfo iTextToUnicodeInfo, 
    ConstStr255Param iPascalStr, 
    ByteCount iOutputBufLen, 
    ByteCount *oUnicodeLen, 
    UniCharArrayPtr oUnicodeStr
);
Parameter descriptions
iTextToUnicodeInfo

A Unicode converter object of type TextToUnicodeInfo for the Pascal string to be converted. You can use the function CreateTextToUnicodeInfo or CreateTextToUnicodeInfoByEncoding to create the Unicode converter object.

iPascalStr

The Pascal string to be converted to Unicode.

iOutputBufLen

The length in bytes of the output buffer pointed to by the oUnicodeStr parameter. Your application supplies this buffer to hold the returned converted string. The oUnicodeLen parameter may return a byte count that is less than this value if the converted string is smaller than the buffer size you allocated.

oUnicodeLen

On return, a pointer to the length in bytes of the converted Unicode string returned in the oUnicodeStr parameter.

oUnicodeStr

A pointer to a Unicode character array. On return, this array holds the converted Unicode string.

function result

A result code.

DISCUSSION

The ConvertFromPStringToUnicode function provides an easy and efficient way to convert a short Pascal string to a Unicode string without incurring the overhead associated with the function ConvertFromTextToUnicode.

If necessary, this function automatically uses fallback characters to map the text elements of the string.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)