---
title: ConvertFromPStringToUnicode
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: coreservices/1433483-convertfrompstringtounicode
---

# ConvertFromPStringToUnicode

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

## Declaration

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

## Parameters

- `iTextToUnicodeInfo`: A Unicode converter object of type doc://com.apple.documentation/documentation/coreservices/texttounicodeinfo for the Pascal string to be converted. You can use the function doc://com.apple.documentation/documentation/coreservices/1433598-createtexttounicodeinfo or doc://com.apple.documentation/documentation/coreservices/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

Return Value A resultcode. See Result Codes.

## Discussion

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

- [ConvertFromUnicodeToPString](coreservices/1433581-convertfromunicodetopstring.md)
