InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CTUnicodeTranslator Class Reference

#include <CTUnicodeTranslator.h>

Public Member Functions

int32 CharToTextChar (const char *fromString, int32 fromStrLength, UTF16TextChar *toString, int32 toStrLength, int32 writingscript=kDontKnowScript)
 
int32 TextCharToChar (const UTF16TextChar *fromString, int32 fromStrCharCount, char *toString, int32 toStrLength, int32 writingscript=kDontKnowScript)
 
int32 TextCharToChar_Exact (const textchar *fromString, int32 fromStrCharCount, char *toString, int32 toStrLength, bool16 &stoppedFlag, int32 &bytesTranslated, int32 writingscript=kDontKnowScript)
 

Static Public Member Functions

static CTUnicodeTranslatorInstance ()
 
static CTEncoding * GetUnicodeEncoding ()
 
static void DeleteInstance ()
 

Protected Member Functions

UnicodeTranslateFromTo * DetermineFontIndependentTranslator (int32 script)
 

Detailed Description

Translate platform string to Unicode and Unicode strings to platform.

Member Function Documentation

int32 CTUnicodeTranslator::CharToTextChar (const char * fromString,
int32 fromStrLength,
UTF16TextChar * toString,
int32 toStrLength,
int32 writingscript = kDontKnowScript 
)

Convert platform buffer to Unicode buffer.

Parameters
fromStringbuffer to translate
fromStrLengthlength of fromString in bytes
toStringOUT buffer to put translation
toStrLengthlength of UTF16TextChar allocated to toString.
writingscriptscript of fromString. if kDontKnowScript then LocaleSetting::GetSystemScript is used
Returns
int32 number of UTF16TextChars written to toString
int32 CTUnicodeTranslator::TextCharToChar (const UTF16TextChar * fromString,
int32 fromStrCharCount,
char * toString,
int32 toStrLength,
int32 writingscript = kDontKnowScript 
)

Convert Unicode buffer to platform buffer.

Parameters
fromStringbuffer to translate
fromStrLengthlength of fromString in UTF16TextChars
toStringOUT buffer to put translation
toStrLengthlength of bytes allocated to toString.
writingscriptscript of toString. if kDontKnowScript then LocaleSetting::GetSystemScript is used
Returns
int32 number of bytes written to toString
int32 CTUnicodeTranslator::TextCharToChar_Exact (const textchar * fromString,
int32 fromStrCharCount,
char * toString,
int32 toStrLength,
bool16 & stoppedFlag,
int32 & bytesTranslated,
int32 writingscript = kDontKnowScript 
)

Convert Unicode buffer to platform buffer.

Parameters
fromStringbuffer to translate
fromStrLengthlength of fromString in UTF16TextChars
toStringOUT buffer to put translation
toStrLengthlength of bytes allocated to toString.
stoppedFlagOUT translation was stopped
bytesTranslatedOUT number of bytes translated
writingscriptscript of toString. if kDontKnowScript then LocaleSetting::GetSystemScript is used
Returns
int32 number of bytes written to toString