diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-2068DA42-AE77-5213-B3CF-C3AB7F2188BE.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-2068DA42-AE77-5213-B3CF-C3AB7F2188BE.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,62 @@ + + + + + +Using +a FAT Filename Conversion Plug-inThis section describes how to dynamically load and call a FAT Filename +Conversion plug-in to convert file names between Unicode and Windows code +page. +

This tutorial assumes that you have an understanding of the following:

    +
  • FAT +Filename Conversion Plug-ins Overview introduces Windows code page +and the main purpose of the Plug-ins component.

  • +
+ +Load +the FAT Filename Conversion plug-in DLL. +_LIT(KName,"cp1250"); //The name of the plug-in DLL +const TUid KPluginUid={0x10206A9C}; //DLL UID acquired from Symbian +RLibrary lib; + +//Encapsulate the UID of this DLL in TUidType. +const TUidType serverUid(KNullUid,KNullUid,KPluginUid); + +//load the DLL +User::LeaveIfError(lib.Load(KName,serverUid)); +

In this example, cp1250.dll is dynamically loaded. +A function is then called to convert a character from Unicode to CP1250.

+
+ +Get the exported function from the DLL. +// Function at ordinal 1 converts text from a Unicode to CP1250. +TLibraryFunction function1 = lib.Lookup(1); + +typedef void (*TConvertFromUnicodeL)(TDes8&, const TDesC16&); +TConvertFromUnicodeL aConvertFromUnicodeL = + reinterpret_cast <TConvertFromUnicodeL> (function1); + + +Call the function to convert the text from Unicode to CP1250. +TBuf8<15> foreign1; +_LIT16(Uni_1, "\x0053\x0059\x004D\x0042\x0049\x0041\x004E\xFFFD\x20AC\x02C7\x2015"); +const TDesC16& unicode1(Uni_1); +(*aConvertFromUnicodeL)(foreign1, unicode1); +... + + +Close the DLL. +lib.Close(); + +
+

The parameter foreign1 is returned with the value "\0x53\0x59\0x4D\0x42\0x49\0x41\0x4E\0x81\0x80\0xA1\0x5F" which is in the CP1250 encoding.

+
+Creating +a FAT Filename Conversion Plug-in +
\ No newline at end of file