Home |
Function RTFSetDefaultOpenFlags Function RTFSetCriticalErrorHandler Function RTFDefaultCriticalErrorHandler Function RTFUnicodeToChar |
Function RTFUnicodeToCharRTFUnicodeToChar translates a 16-bit Unicode string (for example, a file name) to an 8-bit character set: int RTFUnicodeToChar(UINT CodePage, const wchar_t * Src, char * Dest, UINT MaxLength); ParametersCodePageCode page identifier used for the translation. Use value 65001 for UTF-8 and 0 for the current default code page set through the last call to RTFSetCodePage or RTFSetCodePageUTF8. SrcPointer to a NUL-terminated Unicode string to translate. DestPointer to a buffer to receive the translated string. MaxLengthSize in bytes of the buffer pointed to by Dest. return valueIf RTFUnicodeToChar succeeds, it returns the number of bytes written to *Dest, including the terminating NUL byte. On failure, a negative error code is returned. Characters not present in the target code page are translated to the underscore character '_'. This function always accepts code page 437 and 65001 (UTF-8). Code page 1252 is only accepted if function RTFSetCodePageANSI has previously been called. RTFSetCodePageANSI does not need to be the last call to RTFSetCodePage. RTFSetCodePage will cache code page 1252. Other code pages are only accepted if they are the current default code page (i.e. the last call to RTFSetCodePage specified the respective code page).
|