Contents

ConvertFromPStringToUnicode

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

Declaration

OSStatus ConvertFromPStringToUnicode(TextToUnicodeInfo iTextToUnicodeInfo, ConstStr255Param iPascalStr, ByteCount iOutputBufLen, ByteCount *oUnicodeLen, UniChar oUnicodeStr[]);

Parameters

  • iTextToUnicodeInfo:

    A Unicode converter object of type Texttounicodeinfo for the Pascal string to be converted. You can use the function 1433598 Createtexttounicodeinfo or 1433560 Createtexttounicodeinfobyencodin 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.

Return Value

A resultcode. See Result Codes.

Discussion

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

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

See Also

Converting Between Unicode and Pascal Strings