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 (MIUNICODE *buf, int charset)
LIBEXPORT int MucConvertFromISO2022 (void *vcd, const void *vinbuf, char **outbuf)
LIBEXPORT int MucConvertFromUnicode (void *vcd, const MIUNICODE *ucbuf, void **outbufp)
LIBEXPORT int MucConvertISO2022aToUnicode (const void *, MIUNICODE **)
LIBEXPORT int MucConvertISO2022ToUnicode (const void *, MIUNICODE **)
LIBEXPORT int MucConvertToISO2022 (void *vcd, const void *vinbuf, char **outbuf)
LIBEXPORT int MucConvertToUnicode (void *vcd, const void *vinbuf, MIUNICODE **outbuf)
LIBEXPORT int MucConvertUnicodeGen (const MIUNICODE *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 MIUNICODE *inbuf, char **outbuf)
LIBEXPORT int MucConvertUnicodeToUTF8 (const MIUNICODE *instr, UINT8 **outstr)
LIBEXPORT int MucConvertUTF8ToUnicode (const UINT8 *instr, MIUNICODE **outstr)
LIBEXPORT MIUNICODEMucDecompose (const MIUNICODE *string)
LIBEXPORT MIUNICODEMucDoGlyphSubstitutions (const MIUNICODE *instr, bool(*CB_AllowSub)(const UCDATA *sub, void *cbdata), void *cbdata, UINT32 flags=0)
LIBEXPORT MIUNICODEMucFlipVisualAndLogicalOrder (const MIUNICODE *)
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 MIUNICODE *filename, const char *filemode, const char *encoding, void **handle)
LIBEXPORT void MucFPrintfU (void *handle, const MIUNICODE *format,...)
LIBEXPORT void MucFPrintfUV (void *handle, const MIUNICODE *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 MIUNICODE *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 MIUNICODE *in)
LIBEXPORT ERRVALUE MucIndicGlyphSubstitutions (const MIUNICODE *instr, MIUNICODE **outstr, SCRIPTTAG script=SCRIPTTAG_Default, INT32 len=-1, bool bApplyRephHack=false)
LIBEXPORT int MucInitConversion (void **handle, const char *encoding, UINT32 flags)
LIBEXPORT bool MucIsThaiLowerVowel (MIUNICODE ch)
LIBEXPORT bool MucIsThaiTone (MIUNICODE ch)
LIBEXPORT bool MucIsThaiUpperVowel (MIUNICODE ch)
LIBEXPORT bool MucIsThaiVowel (MIUNICODE ch)
LIBEXPORT int MucNameToCharset (const char *name, ENCODELIST_FLAGS flags)
LIBEXPORT char * MucNameToDesc (const char *name)
LIBEXPORT MIUNICODEMucNameToDescUC (const char *name)
LIBEXPORT int MucNameToNum (const char *name, ENCODELIST_FLAGS flags)
LIBEXPORT char * MucNumToDesc (int num, ENCODELIST_FLAGS flags)
LIBEXPORT MIUNICODEMucNumToDescUC (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, MIUNICODE **ucp)
LIBEXPORT MIUNICODEMucRecompose (const MIUNICODE *string)
LIBEXPORT void MucReset (void *handle)
LIBEXPORT void MucStopConversion (void *handle)
LIBEXPORT int MucStrLenISO2022 (const void *vinbuf)
LIBEXPORT MIUNICODEMucThaiShiftTonesAndVowels (const MIUNICODE *str, UINT32 fontencoding)
LIBEXPORT int MucUnicodeToCharset (int val, int charset)
LIBEXPORT MIUNICODEstrntouc (MIUNICODE *dest, const char *source, int len)
LIBEXPORT MIUNICODEstrtouc (MIUNICODE *dest, const char *source)
LIBEXPORT MIUNICODEstrtouccat (MIUNICODE *dest, const char *source)
LIBEXPORT MIUNICODEstrtoucdup (const char *)
bool ucisdigit (MIUNICODE digit)
LIBEXPORT DEPRECATED char * ucntostr (char *dest, const MIUNICODE *source, int len)
LIBEXPORT MIUNICODEucstrcat (MIUNICODE *dest, const MIUNICODE *source)
LIBEXPORT MIUNICODEucstrchr (const MIUNICODE *p, MIUNICODE value)
LIBEXPORT int ucstrcmp (const MIUNICODE *p1, const MIUNICODE *p2)
LIBEXPORT MIUNICODEucstrcpy (MIUNICODE *dest, const MIUNICODE *source)
LIBEXPORT MIUNICODEucstrdup (const MIUNICODE *s)
LIBEXPORT int ucstricmp (const MIUNICODE *p1, const MIUNICODE *p2)
LIBEXPORT size_t ucstrlen (const MIUNICODE *p)
LIBEXPORT MIUNICODEucstrlwr (MIUNICODE *p)
LIBEXPORT MIUNICODEucstrncat (MIUNICODE *p1, const MIUNICODE *p2, int len)
LIBEXPORT int ucstrncmp (const MIUNICODE *p1, const MIUNICODE *p2, int len)
LIBEXPORT MIUNICODEucstrncpy (MIUNICODE *dest, const MIUNICODE *source, int len)
LIBEXPORT int ucstrnicmp (const MIUNICODE *p1, const MIUNICODE *p2, int len)
LIBEXPORT MIUNICODEucstrpbrk (MIUNICODE *s, MIUNICODE *accept)
LIBEXPORT MIUNICODEucstrrchr (MIUNICODE *s, MIUNICODE value)
LIBEXPORT size_t ucstrspn (const MIUNICODE *s, const MIUNICODE *accept)
LIBEXPORT MIUNICODEucstrstr (MIUNICODE *s, const MIUNICODE *p)
LIBEXPORT MIUNICODEucstrtok (MIUNICODE *s, MIUNICODE *delim)
LIBEXPORT MIUNICODEucstrupr (MIUNICODE *p)
LIBEXPORT DEPRECATED char * uctostr (char *dest, const MIUNICODE *source)
LIBEXPORT DEPRECATED char * uctostrdup (const MIUNICODE *)

Detailed Description

:Associate with "Unicode Functions"


Define Documentation

#define ENCODING_ASCII   ENCODING_ISO2022

Definition at line 1800 of file ucstring.h.

#define ENCODING_ISO2022   0

Definition at line 1799 of file ucstring.h.

#define ENCODING_Unicode   -1

Definition at line 1798 of file ucstring.h.

#define GLYPHSUB_AllowCircleForms   0x00000200

Definition at line 1399 of file ucstring.h.

#define GLYPHSUB_AllowCompatForms   0x00000004

Compatibility (equivalent) forms.

Definition at line 1392 of file ucstring.h.

#define GLYPHSUB_AllowFontForms   0x00000400

Definition at line 1400 of file ucstring.h.

#define GLYPHSUB_AllowFractionForms   0x00000010

"1/2" -> single glyph

Definition at line 1394 of file ucstring.h.

#define GLYPHSUB_AllowNarrowForms   0x00000002

Definition at line 1391 of file ucstring.h.

#define GLYPHSUB_AllowNoBreakForms   0x00000800

Definition at line 1401 of file ucstring.h.

#define GLYPHSUB_AllowPositionalForms   0x00000008

Arabic/Hebrew.

Definition at line 1393 of file ucstring.h.

#define GLYPHSUB_AllowSmallForms   0x00000080

Definition at line 1397 of file ucstring.h.

#define GLYPHSUB_AllowSquareForms   0x00000100

Definition at line 1398 of file ucstring.h.

#define GLYPHSUB_AllowSubscriptForms   0x00000020

Definition at line 1395 of file ucstring.h.

#define GLYPHSUB_AllowSuperscriptForms   0x00000040

Definition at line 1396 of file ucstring.h.

#define GLYPHSUB_AllowVerticalForms   0x00001000

Definition at line 1402 of file ucstring.h.

#define GLYPHSUB_AllowWideForms   0x00000001

Definition at line 1390 of file ucstring.h.

#define MUC_THAI_OF   1

Definition at line 1700 of file ucstring.h.

#define MUC_THAI_TTF   2

Definition at line 1701 of file ucstring.h.

#define MUCEVENT_ComposeOff   0x02

Definition at line 1803 of file ucstring.h.

#define MUCEVENT_ComposeOn   0x01

Definition at line 1802 of file ucstring.h.

#define MUCEVENT_ComposeToggle   (MUCEVENT_ComposeOn|MUCEVENT_ComposeOff)

Definition at line 1804 of file ucstring.h.


Function Documentation

LIBEXPORT int MucCharsetToUnicode ( int  val,
int  charset 
)

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

LIBEXPORT int MucCharsetToUnicodeBuf ( MIUNICODE buf,
int  charset 
)

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

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 MIUNICODE ucbuf,
void **  outbufp 
)

Convert string from MIUNICODE to anything.

LIBEXPORT int MucConvertISO2022aToUnicode ( const void *  ,
MIUNICODE **   
)

Convert an ISO-2022a string to MIUNICODE.

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 *  ,
MIUNICODE **   
)

Convert an ISO-2022 string to MIUNICODE.

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,
MIUNICODE **  outbuf 
)

Convert string from anything to MIUNICODE.

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 MIUNICODE inbuf,
int(*)(int NewCharset, int OldCharset, void *UserData)  NewCharsetFunc,
int(*)(UINT8 *chars, int len, void *UserData)  AddCharsFunc,
void *  UserData,
UINT32  flags 
)

Convert string from MIUNICODE by calling callbacks.

This function can be used to convert a string from MIUNICODE 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 MIUNICODE inbuf,
char **  outbuf 
)

Convert a MIUNICODE string to ISO-2022.

The caller should free the buffer returned

LIBEXPORT int MucConvertUnicodeToUTF8 ( const MIUNICODE instr,
UINT8 **  outstr 
)

Convert MIUNICODE (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,
MIUNICODE **  outstr 
)

Convert UTF8 to MIUNICODE (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 MIUNICODE* MucDecompose ( const MIUNICODE 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 MIUNICODE* MucDoGlyphSubstitutions ( const MIUNICODE instr,
bool(*)(const UCDATA *sub, void *cbdata)  CB_AllowSub,
void *  cbdata,
UINT32  flags = 0 
)

Perform glyph substitutions on a MIUNICODE string. 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 MIUNICODE* MucFlipVisualAndLogicalOrder ( const MIUNICODE  ) 

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 MIUNICODE 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 MIUNICODE format,
  ... 
)

Print to a file with MIUNICODE format string.

handle is a file returned by MucFPrintfOpen()

See also:
MucFprintfOpen()

LIBEXPORT void MucFPrintfUV ( void *  handle,
const MIUNICODE format,
va_list   
)

Print to a file with MIUNICODE 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 MIUNICODE 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 MIUNICODE

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 MIUNICODE
Returns:
Index into array or -1 if encoding not found.

LIBEXPORT int MucGetGlyphDirection ( const MIUNICODE uc,
int  curdir,
UINT8 glyphflags 
)

Determine the direction of a glyph.

Given a MIUNICODE 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)

glyphflags

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 MIUNICODE

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 MIUNICODE in  ) 

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

LIBEXPORT ERRVALUE MucIndicGlyphSubstitutions ( const MIUNICODE instr,
MIUNICODE **  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 MIUNICODE conversion handle.

LIBEXPORT bool MucIsThaiLowerVowel ( MIUNICODE  ch  ) 

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

LIBEXPORT bool MucIsThaiTone ( MIUNICODE  ch  ) 

Returns true if ch is a Thai tone character.

LIBEXPORT bool MucIsThaiUpperVowel ( MIUNICODE  ch  ) 

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

LIBEXPORT bool MucIsThaiVowel ( MIUNICODE  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 MIUNICODE* MucNameToDescUC ( const char *  name  ) 

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

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 MIUNICODE* MucNumToDescUC ( int  num,
ENCODELIST_FLAGS  flags 
)

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

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,
MIUNICODE **  ucp 
)

Don't use this function.

LIBEXPORT MIUNICODE* MucRecompose ( const MIUNICODE 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 MIUNICODE 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 MIUNICODE and called ucstrlen() on the result, but without going to the actual work.

LIBEXPORT MIUNICODE* MucThaiShiftTonesAndVowels ( const MIUNICODE str,
UINT32  fontencoding 
)

Parameters:
fontencoding  MUC_THAI_OF or MUC_THAI_TTF

LIBEXPORT int MucUnicodeToCharset ( int  val,
int  charset 
)

Convert a single MIUNICODE character to a given character set.

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

LIBEXPORT MIUNICODE* strntouc ( MIUNICODE 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 (MIUNICODE)

LIBEXPORT MIUNICODE* strtouc ( MIUNICODE 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 (MIUNICODE)

LIBEXPORT MIUNICODE* strtouccat ( MIUNICODE 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 (MIUNICODE)

LIBEXPORT MIUNICODE* strtoucdup ( const char *   ) 

MIUNICODE version of strdup().

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

bool ucisdigit ( MIUNICODE  digit  )  [inline]

MIUNICODE 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 992 of file ucstring.h.

LIBEXPORT DEPRECATED char* ucntostr ( char *  dest,
const MIUNICODE source,
int  len 
)

Convert MIUNICODE 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 MIUNICODE* ucstrcat ( MIUNICODE dest,
const MIUNICODE source 
)

MIUNICODE version of strcat().

LIBEXPORT MIUNICODE* ucstrchr ( const MIUNICODE p,
MIUNICODE  value 
)

MIUNICODE version of strchr().

Find the first occurance of a given character in a Unicode string. R