The Converting text between encodings The "old" procedure

The "old" procedure

Each converter is implemented in a separate DLL in \System\UniFEP\Encoding. Each DLL exports a single function NewConverter that returns an object of type CUniEncoder.

To load a codec DLL, you should not rely on a specific filename (they are different in different versions of UniFEP). When you need a specific codec, use its UID to find the DLL. The UIDs of all codecs currently available from Enfour are defined in "ufcodec.h". You are free to add your own.

To obtain, say, a ShiftJIS codec, you could proceed as in the example file codec.cpp. The example file enccache.cpp shows how to maintain a cache of encoders to be used by your application.

Note that "ufcodec.h" defines UIDs for UTF-8 and Latin-1. These are for internal use only, there are no codec DLLs with these UIDs. (The enccache.cpp example adds UTF-8 to the list of encodings maintained.)

Note that in this framework, the "name" of an encoding is the filename of the DLL, without the extension. This is the name that should be presented to the user when an encoding is being selected.


Otfried Cheong and Enfour, Inc. VersionĀ 2.59, December 31, 2000.

The Converting text between encodings The "old" procedure