MDL-Unicode Support

Hi All,

Can MDL functions supports Unicode Characters?

If not what i will do to support Unicode Characters.

Thanks in Advance,

Jeyankondan.

Parents
  • Unicode

    Jeyankondan:

    Can MDL functions support Unicode Characters?

    In general, the answer is 'yes'. Many functions in V8 are Unicode-only. For example, a model or cell name & description are always Unicode:

    mdlCell_create (..., MSWChar const* cellName , ...)

    The MSWChar type, depending on your build environment, is either a typedef for UShort (a 16-bit value) or for wchar_t, the C++ standard Unicode character type. A Unicode character string variable in MDL is:

    MSWChar unicode_string [MAX_MODEL_NAME_LENGTH];

    Construct a literal Unicode string using the 'L' prefix:

    MSWChar const* const_unicode_string = L"Jeyankondan";

    There are complications: some APIs have not yet been converted and continue to use multibyte ANSI (8-bit char) strings. You can convert between multibyte and Unicode using mdlCnv_convertMultibyteToUnicode and mdlCnv_convertUnicodeToMultibyte.

    The worst complication occurs when you want to construct a text element. The function to construct text is mdlText_createWide (... MSWideChar const* wString, ...), which, you observe, uses a unique data type MSWideChar not MSWChar. This, and its partner mdlText_extractWide, are the the only functions in the entire MDL API that uses that data type. It is not freely interchangable with either multibyte or Unicode, and requires  conversion functions MSWideCharStringToMSWCharString and MSWCharStringToMSWideCharString.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Hi Jon,

    Thank you for your reply.

    But now my problem is i'm retreiving data from database as Arabic Unicode characters, that i want to store in a sting list.

    So i go for mdlStringList_.... functions.

    and also mdlDialog_... functions (to display the data in Arabic characters),

     EX: mdlDialog_optionButtonInsertItem,mdlDialog_listBoxInsertColumn...and so on.

    The above mentioned functions are still supports only ASCII,

    Will these  functions support Unicode characters?, if not how to convert?

    Thanks & Regards,

    Jeyankondan.

Reply
  • Hi Jon,

    Thank you for your reply.

    But now my problem is i'm retreiving data from database as Arabic Unicode characters, that i want to store in a sting list.

    So i go for mdlStringList_.... functions.

    and also mdlDialog_... functions (to display the data in Arabic characters),

     EX: mdlDialog_optionButtonInsertItem,mdlDialog_listBoxInsertColumn...and so on.

    The above mentioned functions are still supports only ASCII,

    Will these  functions support Unicode characters?, if not how to convert?

    Thanks & Regards,

    Jeyankondan.

Children
  • ListModel

    Jeyankondan:

    I'm retrieving data from a database as Unicode characters that I want to store in a string list.

    StringLists are a relic from the first version of MDL released in about 1993.  They can accommodate only multibyte text (i.e. there is no Unicode version of  StringList). StringLists are superseded in V8 by the ListModel.

    A ListModel can accommodate various data types, including both multibyte and Unicode text and various numeric types.

    If you want to display a list of text in, say, a ListBox, you can use a ListModel. For example, mdlDialog_listBoxSetListModelP.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions