Unicode Functions

:Associate with "Unicode Functions" More...

Defines

#define ENCODING_ASCII   ENCODING_ISO2022
#define ENCODING_ISO2022   0
#define ENCODING_Unicode   -1
#define GLYPHSUB_AllowCircleForms   0x00000200
#define GLYPHSUB_AllowCompatForms   0x00000004
#define GLYPHSUB_AllowFontForms   0x00000400
#define GLYPHSUB_AllowFractionForms   0x00000010
#define GLYPHSUB_AllowNarrowForms   0x00000002
#define GLYPHSUB_AllowNoBreakForms   0x00000800
#define GLYPHSUB_AllowPositionalForms   0x00000008
#define GLYPHSUB_AllowSmallForms   0x00000080
#define GLYPHSUB_AllowSquareForms   0x00000100
#define GLYPHSUB_AllowSubscriptForms   0x00000020
#define GLYPHSUB_AllowSuperscriptForms   0x00000040
#define GLYPHSUB_AllowVerticalForms   0x00001000
#define GLYPHSUB_AllowWideForms   0x00000001
#define MUC_THAI_OF   1
#define MUC_THAI_TTF   2
#define MUCEVENT_ComposeOff   0x02
#define MUCEVENT_ComposeOn   0x01
#define MUCEVENT_ComposeToggle   (MUCEVENT_ComposeOn|MUCEVENT_ComposeOff)

Functions

LIBEXPORT int MucCharsetToUnicode (int val, int charset)
LIBEXPORT int MucCharsetToUnicodeBuf (UNICODE *buf, int charset)
LIBEXPORT int MucConvertFromISO2022 (void *vcd, const void *vinbuf, char **outbuf)
LIBEXPORT int MucConvertFromUnicode (void *vcd, const UNICODE *ucbuf, void **outbufp)
LIBEXPORT int MucConvertISO2022aToUnicode (const void *, UNICODE **)
LIBEXPORT int MucConvertISO2022ToUnicode (const void *, UNICODE **)
LIBEXPORT int MucConvertToISO2022 (void *vcd, const void *vinbuf, char **outbuf)
LIBEXPORT int MucConvertToUnicode (void *vcd, const void *vinbuf, UNICODE **outbuf)
LIBEXPORT int MucConvertUnicodeGen (const UNICODE *inbuf, int(*NewCharsetFunc)(int NewCharset, int OldCharset, void *UserData), int(*AddCharsFunc)(UINT8 *chars, int len, void *UserData), void *UserData, UINT32 flags)
LIBEXPORT int MucConvertUnicodeToISO2022 (const UNICODE *inbuf, char **outbuf)
LIBEXPORT int MucConvertUnicodeToUTF8 (const UNICODE *instr, UINT8 **outstr)
LIBEXPORT int MucConvertUTF8ToUnicode (const UINT8 *instr, UNICODE **outstr)
LIBEXPORT UNICODEMucDecompose (const UNICODE *string)
LIBEXPORT UNICODEMucDoGlyphSubstitutions (const UNICODE *instr, bool(*CB_AllowSub)(const UCDATA *sub, void *cbdata), void *cbdata, UINT32 flags=0)
LIBEXPORT UNICODEMucFlipVisualAndLogicalOrder (const UNICODE *)
LIBEXPORT void MucFPrintfA (void *handle, const char *format,...)
LIBEXPORT void MucFPrintfAV (void *handle, const char *format, va_list)
LIBEXPORT void MucFPrintfClose (void *handle)
LIBEXPORT void MucFPrintfFlush (void *handle)
LIBEXPORT int MucFPrintfOpen (const UNICODE *filename, const char *filemode, const char *encoding, void **handle)
LIBEXPORT void MucFPrintfU (void *handle, const UNICODE *format,...)
LIBEXPORT void MucFPrintfUV (void *handle, const UNICODE *format, va_list)
LIBEXPORT int MucGetDefaultCharsets (int *charset1, int *charset2, int *charset3)
LIBEXPORT CHAR_ENCODING MucGetEncodingFromName (const char *name)
LIBEXPORT CHAR_ENCODING MucGetEncodingFromNum (int num, ENCODELIST_FLAGS flags)
LIBEXPORT int MucGetEncodingNum (CHAR_ENCODING encoding, ENCODELIST_FLAGS flags)
LIBEXPORT int MucGetGlyphDirection (const UNICODE *uc, int curdir, UINT8 *glyphflags)
LIBEXPORT const char * MucGetName (CHAR_ENCODING encoding)
LIBEXPORT int MucGetNumEncodings (ENCODELIST_FLAGS flags)
LIBEXPORT int MucGuessJapaneseEncoding (const UINT8 *in, char *encoding)
LIBEXPORT int MucHasRightToLeftTextISO2022 (const char *in)
LIBEXPORT int MucHasRightToLeftTextUC (const UNICODE *in)
LIBEXPORT ERRVALUE MucIndicGlyphSubstitutions (const UNICODE *instr, UNICODE **outstr, SCRIPTTAG script=SCRIPTTAG_Default, INT32 len=-1, bool bApplyRephHack=false)
LIBEXPORT int MucInitConversion (void **handle, const char *encoding, UINT32 flags)
LIBEXPORT bool MucIsThaiLowerVowel (UNICODE ch)
LIBEXPORT bool MucIsThaiTone (UNICODE ch)
LIBEXPORT bool MucIsThaiUpperVowel (UNICODE ch)
LIBEXPORT bool MucIsThaiVowel (UNICODE ch)
LIBEXPORT int MucNameToCharset (const char *name, ENCODELIST_FLAGS flags)
LIBEXPORT char * MucNameToDesc (const char *name)
LIBEXPORT UNICODEMucNameToDescUC (const char *name)
LIBEXPORT int MucNameToNum (const char *name, ENCODELIST_FLAGS flags)
LIBEXPORT char * MucNumToDesc (int num, ENCODELIST_FLAGS flags)
LIBEXPORT UNICODEMucNumToDescUC (int num, ENCODELIST_FLAGS flags)
LIBEXPORT const char * MucNumToName (int num, ENCODELIST_FLAGS flags)
LIBEXPORT int MucQuickConvToISO2022 (int encodetype, const void *in, char **outp)
LIBEXPORT int MucQuickConvToUnicode (int encodetype, const void *in, UNICODE **ucp)
LIBEXPORT UNICODEMucRecompose (const UNICODE *string)
LIBEXPORT void MucReset (void *handle)
LIBEXPORT void MucStopConversion (void *handle)
LIBEXPORT int MucStrLenISO2022 (const void *vinbuf)
LIBEXPORT UNICODEMucThaiShiftTonesAndVowels (const UNICODE *str, UINT32 fontencoding)
LIBEXPORT int MucUnicodeToCharset (int val, int charset)
LIBEXPORT UNICODEstrntouc (UNICODE *dest, const char *source, int len)
LIBEXPORT UNICODEstrtouc (UNICODE *dest, const char *source)
LIBEXPORT UNICODEstrtouccat (UNICODE *dest, const char *source)
LIBEXPORT UNICODEstrtoucdup (const char *)
bool ucisdigit (UNICODE digit)
LIBEXPORT DEPRECATED char * ucntostr (char *dest, const UNICODE *source, int len)
LIBEXPORT UNICODEucstrcat (UNICODE *dest, const UNICODE *source)
LIBEXPORT UNICODEucstrchr (const UNICODE *p, UNICODE value)
LIBEXPORT int ucstrcmp (const UNICODE *p1, const UNICODE *p2)
LIBEXPORT UNICODEucstrcpy (UNICODE *dest, const UNICODE *source)
LIBEXPORT UNICODEucstrdup (const UNICODE *s)
LIBEXPORT int ucstricmp (const UNICODE *p1, const UNICODE *p2)
LIBEXPORT size_t ucstrlen (const UNICODE *p)
LIBEXPORT UNICODEucstrlwr (UNICODE *p)
LIBEXPORT UNICODEucstrncat (UNICODE *p1, const UNICODE *p2, int len)
LIBEXPORT int ucstrncmp (const UNICODE *p1, const UNICODE *p2, int len)
LIBEXPORT UNICODEucstrncpy (UNICODE *dest, const UNICODE *source, int len)
LIBEXPORT int ucstrnicmp (const UNICODE *p1, const UNICODE *p2, int len)
LIBEXPORT UNICODEucstrpbrk (UNICODE *s, UNICODE *accept)
LIBEXPORT UNICODEucstrrchr (UNICODE *s, UNICODE value)
LIBEXPORT size_t ucstrspn (const UNICODE *s, const UNICODE *accept)
LIBEXPORT UNICODEucstrstr (UNICODE *s, const UNICODE *p)
LIBEXPORT UNICODEucstrtok (UNICODE *s, UNICODE *delim)
LIBEXPORT UNICODEucstrupr (UNICODE *p)
LIBEXPORT DEPRECATED char * uctostr (char *dest, const UNICODE *source)
LIBEXPORT DEPRECATED char * uctostrdup (const UNICODE *)

Detailed Description

:Associate with "Unicode Functions"


Define Documentation

#define ENCODING_ASCII   ENCODING_ISO2022
 

Definition at line 1812 of file ucstring.h.

#define ENCODING_ISO2022   0
 

Definition at line 1811 of file ucstring.h.

#define ENCODING_Unicode   -1
 

Definition at line 1810 of file ucstring.h.

#define GLYPHSUB_AllowCircleForms   0x00000200
 

Definition at line 1411 of file ucstring.h.

#define GLYPHSUB_AllowCompatForms   0x00000004
 

Compatibility (equivalent) forms.

Definition at line 1404 of file ucstring.h.

#define GLYPHSUB_AllowFontForms   0x00000400
 

Definition at line 1412 of file ucstring.h.

#define GLYPHSUB_AllowFractionForms   0x00000010
 

"1/2" -> single glyph

Definition at line 1406 of file ucstring.h.

#define GLYPHSUB_AllowNarrowForms   0x00000002
 

Definition at line 1403 of file ucstring.h.

#define GLYPHSUB_AllowNoBreakForms   0x00000800
 

Definition at line 1413 of file ucstring.h.

#define GLYPHSUB_AllowPositionalForms   0x00000008
 

Arabic/Hebrew.

Definition at line 1405 of file ucstring.h.

#define GLYPHSUB_AllowSmallForms   0x00000080
 

Definition at line 1409 of file ucstring.h.

#define GLYPHSUB_AllowSquareForms   0x00000100
 

Definition at line 1410 of file ucstring.h.

#define GLYPHSUB_AllowSubscriptForms   0x00000020
 

Definition at line 1407 of file ucstring.h.

#define GLYPHSUB_AllowSuperscriptForms   0x00000040
 

Definition at line 1408 of file ucstring.h.

#define GLYPHSUB_AllowVerticalForms   0x00001000
 

Definition at line 1414 of file ucstring.h.

#define GLYPHSUB_AllowWideForms   0x00000001
 

Definition at line 1402 of file ucstring.h.

#define MUC_THAI_OF   1
 

Definition at line 1712 of file ucstring.h.

#define MUC_THAI_TTF   2
 

Definition at line 1713 of file ucstring.h.

#define MUCEVENT_ComposeOff   0x02
 

Definition at line 1815 of file ucstring.h.

#define MUCEVENT_ComposeOn   0x01
 

Definition at line 1814 of file ucstring.h.

#define MUCEVENT_ComposeToggle   (MUCEVENT_ComposeOn|MUCEVENT_ComposeOff)
 

Definition at line 1816 of file ucstring.h.


Function Documentation

LIBEXPORT int MucCharsetToUnicode int  val,
int  charset
 

Convert a single character from a given character set to UNICODE.

LIBEXPORT int MucCharsetToUnicodeBuf UNICODE buf,
int  charset
 

Convert a string characters from a given character set to UNICODE.

Operates in-place.

LIBEXPORT int MucConvertFromISO2022 void *  vcd,
const void *  vinbuf,
char **  outbuf
 

Convert string from ISO-2022 to anything.

LIBEXPORT int MucConvertFromUnicode void *  vcd,
const UNICODE ucbuf,
void **  outbufp
 

Convert string from UNICODE to anything.

LIBEXPORT int MucConvertISO2022aToUnicode const void *  ,
UNICODE ** 
 

Convert an ISO-2022a string to UNICODE.

ISO-2022a is a MicroImages invention -- a slightly modified version of ISO-2022 in which all backslashes are doubled. This is done because X resource files try to intrepret back slashes as something special even it the backslash is the 2nd byte of a 2-byte character.

The caller should free the buffer returned

LIBEXPORT int MucConvertISO2022ToUnicode const void *  ,
UNICODE ** 
 

Convert an ISO-2022 string to UNICODE.

The caller should free the buffer returned

LIBEXPORT int MucConvertToISO2022 void *  vcd,
const void *  vinbuf,
char **  outbuf
 

Convert string from anything to ISO-2022.

The "vcd" must have been initialized by calling MucInitConversion(). Assumes vinbuf is whatever vcd was initialized to. Caller must free outbuf when done

LIBEXPORT int MucConvertToUnicode void *  vcd,
const void *  vinbuf,
UNICODE **  outbuf
 

Convert string from anything to UNICODE.

The "vcd" must have been initialized by calling MucInitConversion(). Assumes vinbuf is whatever vcd was initialized to. Caller must free outbuf when done

LIBEXPORT int MucConvertUnicodeGen const UNICODE inbuf,
int(*  NewCharsetFunc)(int NewCharset, int OldCharset, void *UserData),
int(*  AddCharsFunc)(UINT8 *chars, int len, void *UserData),
void *  UserData,
UINT32  flags
 

Convert string from UNICODE by calling callbacks.

This function can be used to convert a string from UNICODE to just about anything. It assumes ISO-8859-1 as an initial character set.

NewCharsetFunc() will be called when the function detects a character not available in the current character set. It tells you what character set it was in and what character set it wants to switch to. At this point, you can do whatever you need to do to switch fonts to one that supports the requested character set. You should return 0 or an error code < 0.

AddCharsFunc() is called when an internal buffer fills up or just before calling NewCharsetFunc() to let add the characters to your output buffer or display them or whatever it is you're doing. The "characters" passed to you may be multi-byte. If this is the case, "len" is in bytes.

LIBEXPORT int MucConvertUnicodeToISO2022 const UNICODE inbuf,
char **  outbuf
 

Convert a UNICODE string to ISO-2022.

The caller should free the buffer returned

LIBEXPORT int MucConvertUnicodeToUTF8 const UNICODE instr,
UINT8 **  outstr
 

Convert UNICODE (UTF-16) to UTF8.

Warning! This function assumes that the pointer passed in for outstr is either NULL or can be realloc'd as needed. You must therefore initialize it to somthing.

LIBEXPORT int MucConvertUTF8ToUnicode const UINT8 instr,
UNICODE **  outstr
 

Convert UTF8 to UNICODE (UTF-16).

Warning! This function assumes that the pointer passed in for outstr is either NULL or can be realloc'd as needed. You must therefore initialize it to somthing.

LIBEXPORT UNICODE* MucDecompose const UNICODE string  ) 
 

Decompose a Unicode string into Canonical form.

In a cononical Unicode string, all decomposable characters are decomposed. For example, 0x00E9 (LATIN SMALL LETTER E WITH ACUTE) is represented as 0x0065 (LATIN SMALL LETTER E) + 0x0301 (COMBINING ACUTE ACCENT)

The caller should free the returned string

LIBEXPORT UNICODE* MucDoGlyphSubstitutions const UNICODE instr,
bool(*  CB_AllowSub)(const UCDATA *sub, void *cbdata),
void *  cbdata,
UINT32  flags = 0
 

c++

This function returns a copy of the given string after performing glyph substitutions based on the decomposition data in UnicodeData.txt (which we've cooked into a compact form, ucdata.ref)

Note: This function assumes the input string is in logical order and does not flip it in any way.

Parameters:
instr String to convert
CB_AllowSub Aallows you to intercept and deny substitutions. A good use for this feature would be to verify that the selected font has a given glyph available before allowing the substitution. The callback should return true to allow the substitution, false to prevent it. If no callback is provided, all substitutions are allowed.
cbdata Callback data. Will be passed to CB_AllowSub as the 2nd parameter
flags 
  • GLYPHSUB_AllowWideForms Wide (or zenkaku) compatibility characters
  • GLYPHSUB_AllowNarrowForms Narrow (or hankaku) compatibility characters
  • GLYPHSUB_AllowCompatForms Compatibility (equivalent) forms
  • GLYPHSUB_AllowPositionalForms Arabic/Hebrew positional forms
  • GLYPHSUB_AllowFractionForms Converts the three characters "1/2" to a single fraction glyph
  • GLYPHSUB_AllowSubscriptForms
  • GLYPHSUB_AllowSuperscriptForms
  • GLYPHSUB_AllowSmallForms Small variant forms (CNS compatibility)
  • GLYPHSUB_AllowSquareForms CJK squared font variant
  • GLYPHSUB_AllowCircleForms Encircled forms
  • GLYPHSUB_AllowFontForms Font variants (e.g. a blackletter form)
  • GLYPHSUB_AllowNoBreakForms Non-breaking spaces and hyphens
  • GLYPHSUB_AllowVerticalForms Vertical presentation forms

LIBEXPORT UNICODE* MucFlipVisualAndLogicalOrder const UNICODE  ) 
 

Flip Right-To-Left text to "visual" order.

Returns a copy of the input string which caller must free. This function is symetric. That is, flipping the same string twice gives the original string.

LIBEXPORT void MucFPrintfA void *  handle,
const char *  format,
  ...
 

Print to a file with ASCII format string.

handle is a file returned by MucFPrintfOpen()

See also:
MucFprintfOpen()

LIBEXPORT void MucFPrintfAV void *  handle,
const char *  format,
va_list 
 

Print to a file with ASCII format string (va_list version).

handle is a file returned by MucFPrintfOpen()

See also:
MucFprintfOpen()

LIBEXPORT void MucFPrintfClose void *  handle  ) 
 

Close a text file opend with MucFPrintfOpen().

See also:
MucFprintfOpen()

LIBEXPORT void MucFPrintfFlush void *  handle  ) 
 

Flush a text file opend with MucFPrintfOpen().

See also:
MucFprintfOpen()

LIBEXPORT int MucFPrintfOpen const UNICODE filename,
const char *  filemode,
const char *  encoding,
void **  handle
 

Open a text file for use with MucFprint functions.

See also:
MucFprintfClose()
Parameters:
filemode  "r", "w", etc...
handle  Handle returned

LIBEXPORT void MucFPrintfU void *  handle,
const UNICODE format,
  ...
 

Print to a file with UNICODE format string.

handle is a file returned by MucFPrintfOpen()

See also:
MucFprintfOpen()

LIBEXPORT void MucFPrintfUV void *  handle,
const UNICODE format,
va_list 
 

Print to a file with UNICODE format string (va_list version).

handle is a file returned by MucFPrintfOpen()

See also:
MucFprintfOpen()

LIBEXPORT int MucGetDefaultCharsets int *  charset1,
int *  charset2,
int *  charset3
 

Returns the default charset for keyboard input.

Returns 3 charset codes which can be used as hints when trying to convert UNICODE to ISO-2022. This is used by the input of the XeText widget.

Parameters:
charset1 Charset to use for single-byte things < 128
charset2 Charset to use for single-byte things > 128
charset3 Charset to use for multi-byte things.

LIBEXPORT CHAR_ENCODING MucGetEncodingFromName const char *  name  ) 
 

Given an encoding name, return the CHAR_ENCODING value.

LIBEXPORT CHAR_ENCODING MucGetEncodingFromNum int  num,
ENCODELIST_FLAGS  flags
 

Given an encoding number, return the CHAR_ENCODING value.

This will return the Nth encoding which matches the criteria set forth by the flags parameter. Encoding numbers (as passed to this function) are not fixed and can change at any time. The only thing this function should be used for is retrieving a list of encodings to present the user with a choice.

Parameters:
num The encoding number.
flags 
  • ENCODELIST_FLAG_Any Allow any encoding
  • ENCODELIST_FLAG_Importable Allow importable encodings
  • ENCODELIST_FLAG_Exportable Allow exportable encodings
  • ENCODELIST_FLAG_Both Allow importanble or exportable encodings
  • ENCODELIST_FLAG_NoUnicode Don't include UNICODE

LIBEXPORT int MucGetEncodingNum CHAR_ENCODING  encoding,
ENCODELIST_FLAGS  flags
 

Return the index into array of encodings for a given encoding.

If you use MucGetNumEncodings() and MucNumToName() to iterate through all the encodings of a given type for the purposes of generating a list for the user to select from, then this function is useful for determining which item in that list a given encoding will be so that you can make it the default.

Parameters:
encoding The encoding to find
flags 
  • ENCODELIST_FLAG_Any Allow any encoding
  • ENCODELIST_FLAG_Importable Allow importable encodings
  • ENCODELIST_FLAG_Exportable Allow exportable encodings
  • ENCODELIST_FLAG_Both Allow importanble or exportable encodings
  • ENCODELIST_FLAG_NoUnicode Don't include UNICODE
Returns:
Index into array or -1 if encoding not found.

LIBEXPORT int MucGetGlyphDirection const UNICODE uc,
int  curdir,
UINT8 glyphflags
 

Determine the direction of a glyph.

Given a UNICODE string and a current direction, determine the direction of the next character in the string.

The glyphflags array is filled in by this function.

Directions (both curdir and the return value)

  • MucGLYPHDIRECTION_LtoR
  • MucGLYPHDIRECTION_RtoL
glyphflags
  • MucGLYPHFLAG_PartOfRtoLWord
  • MucGLYPHFLAG_NonJoining
  • MucGLYPHFLAG_Mark

LIBEXPORT const char* MucGetName CHAR_ENCODING  encoding  ) 
 

Return an encoding name.

Once an encoding is named, the name is set in stone and can be written to files without fear of the name changing. The actual name presented to the user is looked up in messages.txt by calling MucNameToDescUC()

Do NOT free the return value from this function

LIBEXPORT int MucGetNumEncodings ENCODELIST_FLAGS  flags  ) 
 

Get the number of supported encodings of a given type.

Parameters:
flags 
  • ENCODELIST_FLAG_Any Allow any encoding
  • ENCODELIST_FLAG_Importable Allow importable encodings
  • ENCODELIST_FLAG_Exportable Allow exportable encodings
  • ENCODELIST_FLAG_Both Allow importanble or exportable encodings
  • ENCODELIST_FLAG_NoUnicode Don't include UNICODE

LIBEXPORT int MucGuessJapaneseEncoding const UINT8 in,
char *  encoding
 

Given a string which may be in either JIS, Shift-JIS, or EUC encoding, try to determine which it is.

The "encoding" string passed in must be big enough to hold the resulting encoding name "Shift-JIS" is the longest string it can return.

LIBEXPORT int MucHasRightToLeftTextISO2022 const char *  in  ) 
 

Determine if an ISO-2022 string has right-to-left text in it.

LIBEXPORT int MucHasRightToLeftTextUC const UNICODE in  ) 
 

Determine if a UNICODE string has right-to-left text in it.

LIBEXPORT ERRVALUE MucIndicGlyphSubstitutions const UNICODE instr,
UNICODE **  outstr,
SCRIPTTAG  script = SCRIPTTAG_Default,
INT32  len = -1,
bool  bApplyRephHack = false
 

Does Indic glyph substitution based on various rules.

script should be one of the following: SCRIPTTAG_Default (See below) SCRIPTTAG_beng (Bengali) SCRIPTTAG_deva (Devanagari) SCRIPTTAG_gujr (Gujarati) SCRIPTTAG_knda (Kannada) SCRIPTTAG_mlym (Malayalam) SCRIPTTAG_orya (Oriya) SCRIPTTAG_punj (punjabi) SCRIPTTAG_taml (Tamil) SCRIPTTAG_telu (Telugu)

If script is SCRIPTTAG_Default, currently it will fall back on Devanagari, but eventually it will try to find the current system script and use that.

The len parameter is used to avoid an extra ucstrlen() call. If the caller already knows the length of instr, pass it. If not, just omit the parameter.

The caller is responsible for freeing outstr

The flag bApplyRephHack is just that, a hack. In order to correctly process the GSUB tables, we need to only apply the 'rphf' table if we have reordered a reph+halant+consonant combination to consonant+reph+halant. In order to do that, we need to somehow distinguish between text where we moved the reph and text where it was already there. To do this, if this flag is set, we change the reph to a fake Unicode character, one that we chose by subtracting 0x30 from the reph glyph. In all the Indic encodings, this falls on an unused code point (for example, 0x0930 becomes 0x0900). The caller knows to look for this and converts it back to the real reph glyph, but sets a flag telling us to process the 'rphf' table on it.

Parameters:
len  Length of instr if known (just to avoid extra ucstrlen())

LIBEXPORT int MucInitConversion void **  handle,
const char *  encoding,
UINT32  flags
 

Initialize a UNICODE conversion handle.

LIBEXPORT bool MucIsThaiLowerVowel UNICODE  ch  ) 
 

Returns true if ch is a Thai vowel character that sits below the consonant.

LIBEXPORT bool MucIsThaiTone UNICODE  ch  ) 
 

Returns true if ch is a Thai tone character.

LIBEXPORT bool MucIsThaiUpperVowel UNICODE  ch  ) 
 

Returns true if ch is a Thai vowel character that sits above the consonant.

LIBEXPORT bool MucIsThaiVowel UNICODE  ch  ) 
 

Returns true if ch is a Thai vowel character.

LIBEXPORT int MucNameToCharset const char *  name,
ENCODELIST_FLAGS  flags
 

Determine the primary character set for a given encoding.

LIBEXPORT char* MucNameToDesc const char *  name  ) 
 

Return the description of an encoding given the name (char*).

This looks up the incoding description from messages.txt. You should free the return value when you're done with it. Don't call this. Calle MucNameToDescUC() instead

See also:
MucNameToDescUC()

LIBEXPORT UNICODE* MucNameToDescUC const char *  name  ) 
 

Return the description of an encoding given the name (UNICODE*).

This looks up the incoding description from messages.txt. You should free the return value when you're done with it.

LIBEXPORT int MucNameToNum const char *  name,
ENCODELIST_FLAGS  flags
 

The opposite of MucNumToName().

LIBEXPORT char* MucNumToDesc int  num,
ENCODELIST_FLAGS  flags
 

Return the description of an encoding given the number (char*).

This looks up the incoding description from messages.txt. You should free the return value when you're done with it. Don't call this. Calle MucNumToDescUC() instead

See also:
MucNumToDescUC()

LIBEXPORT UNICODE* MucNumToDescUC int  num,
ENCODELIST_FLAGS  flags
 

Return the description of an encoding given the number (UNICODE*).

This looks up the incoding description from messages.txt. You should free the return value when you're done with it.

LIBEXPORT const char* MucNumToName int  num,
ENCODELIST_FLAGS  flags
 

Convert an encoding number to its name.

Combines the following two functions

See also:
MucGetEncodingFromNum()

MucGetName()

Do not free the output from this function

LIBEXPORT int MucQuickConvToISO2022 int  encodetype,
const void *  in,
char **  outp
 

Don't use this function.

LIBEXPORT int MucQuickConvToUnicode int  encodetype,
const void *  in,
UNICODE **  ucp
 

Don't use this function.

LIBEXPORT UNICODE* MucRecompose const UNICODE string  ) 
 

Recompose a Canonical form Unicode string into the combined forms.

In a cononical Unicode string, all decomposable characters are decomposed. For example, 0x00E9 (LATIN SMALL LETTER E WITH ACUTE) is represented as 0x0065 (LATIN SMALL LETTER E) + 0x0301 (COMBINING ACUTE ACCENT). This function puts them back together.

The caller should free the returned string

LIBEXPORT void MucReset void *  handle  ) 
 

Reset an Muc handle.

LIBEXPORT void MucStopConversion void *  handle  ) 
 

Stop a UNICODE conversion handle.

LIBEXPORT int MucStrLenISO2022 const void *  vinbuf  ) 
 

Determine the number of characters in an ISO-2022 string.

Since ISO-2022 can consist of single-byte and two-byte characters and escape codes, a simple strlen() won't give you an accurate length. This function gives you the same result you'd get if you converted the string to UNICODE and called ucstrlen() on the result, but without going to the actual work.

LIBEXPORT UNICODE* MucThaiShiftTonesAndVowels const UNICODE str,
UINT32  fontencoding
 

Parameters:
fontencoding  MUC_THAI_OF or MUC_THAI_TTF

LIBEXPORT int MucUnicodeToCharset int  val,
int  charset
 

Convert a single UNICODE character to a given character set.

Returns 0 if the character is not available in the given charset

LIBEXPORT UNICODE* strntouc UNICODE dest,
const char *  source,
int  len
 

Convert an ASCII string to Unicode (with length limit).

Note, this function doesn't do any character set mapping. It simply casts all the source characters to (UNICODE)

LIBEXPORT UNICODE* strtouc UNICODE dest,
const char *  source
 

Convert an ASCII string to Unicode.

Note, this function doesn't do any character set mapping. It simply casts all the source characters to (UNICODE)

LIBEXPORT UNICODE* strtouccat UNICODE dest,
const char *  source
 

Convert an ASCII string to Unicode and append to existing string.

Note, this function doesn't do any character set mapping. It simply casts all the source characters to (UNICODE)

LIBEXPORT UNICODE* strtoucdup const char *   ) 
 

UNICODE version of strdup().

Note, this function doesn't do any character set mapping. It simply casts all the source characters to (UNICODE). The resulting string should be MmFree()'d.

bool ucisdigit UNICODE  digit  )  [inline]
 

UNICODE version of isdigit().

It only detects the ASCII numerals 0-9. Note, that some implementations of isdigit() will crash if given Unicode values > 255.

Definition at line 1004 of file ucstring.h.

LIBEXPORT DEPRECATED char* ucntostr char *  dest,
const UNICODE source,
int  len
 

Convert UNICODE string to ASCII (with length-limit).

Deprecated:
, Use appropriate MISTRING or FILEPATH method instead. Note, this just strips the high byte, so any characters > 255 will produce garbage in the output

LIBEXPORT UNICODE* ucstrcat UNICODE dest,
const UNICODE source
 

UNICODE version of strcat().