|
||
A character conversion plug-in DLL implements conversion between Unicode and another character set. Conversion between Unicode and several common non-Unicode (or "foreign") character sets is built into Symbian OS. Some of the conversion data is hard-coded and some is provided by plug-in DLLs.
For v6.1, the complete list of character sets for which conversion has been implemented in Symbian OS is as follows: UTF-7, UTF-8, ImapUTF-7, Java Conformant UTF-8, Code Page 1252, ISO-8859-1, ASCII, SMS 7-Bit, EUC-JP, GB 12345, GB 2312, GBK, HZ, ISO-2022-JP, ISO-2022-JP1, JIS, Shift-JIS, Big Five. It is important to note that some of these character sets may not be available at run-time, but others (e.g. those written by 3rd parties) may be available.
When preparing to convert to or from Unicode, the CCnvCharacterSetConverter
class searches for and loads the plug-in DLL which implements the
required conversion. The DLL's implementations of the plug-in interface
(ConvertFromUnicode()
and ConvertToUnicode()
) can
then be called by CCnvCharacterSetConverter
's member functions
ConvertFromUnicode()
and ConvertToUnicode()
.
Contents of snm files are read by the
CCnvCharacterSetConverter
class. This information is used to
convert between the character set's internet-standard name or its MIB enum
value and its Symbian-specific UID value.
The following tools are involved in the creation of a character conversion plug-in.
cnvtool
Creating a plug-in character conversion DLL is a two-stage
process — cnvtool
is invoked to generate a C++ file
from two text files which are known as the source file and the control file.
Then, the generated C++ file is compiled along with another (hand-written) C++
file to produce the DLL. For information on cnvtool
syntax see the Tools and Utilities documentation, at cnvtool command syntax.
snmtool
A standard names and MIB enums (snm) file should also be created
if there are any standard names and/or MIB enums for the character set being
implemented (see
ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets).
This is a data file which contains mappings between Internet standard
identifiers of character sets (which may either be names or MIB enums) and
their equivalent Symbian UID. It is generated by a tool called
snmtool
. Information about snmtool
syntax is provided
in the Tools and Utilities documentation, at snmtool command syntax.