5. Customizing Ingres : How to Use a Custom Mapping File for Unicode Coercion
 
Share this page                  
How to Use a Custom Mapping File for Unicode Coercion
The DBMS Server coerces Unicode data to local character set value based on the Unicode converter (or mapping table). Ingres automatically chooses the converter to use, based on the encoding used by the locale on your system.
You can create a custom mapping table for coercing Unicode data to local character set value if, for example, you want to map a particular character to a different Unicode code point, or create a completely new mapping table for an encoding not yet supported by Ingres. Always use the custom mapping table for your encoding once you have implemented it.
Always create a new mapping file. If you wish to modify an originally supplied mapping table for an encoding, do not modify the original mapping files but copy them to a new file name. To avoid data corruption, test your mapping before implementing in a production installation.
If you are using a custom converter (mapping table) for an encoding, make sure that you always use the same converter for that encoding.
The process for creating and using a custom mapping file is as follows:
1. Create a custom mapping file in XML format.
This format should conform to charactermapping.dtd present in the directory $II_SYSTEM/ingres/files/ucharmaps. This directory also contains other converters, which may serve as examples of xml file format. For more information on the xml file format, see http://www.unicode.org/reports/tr22/.
2. Compile this mapping file using unimapcompile utility, as follows:
unimapcompile -o=yourmapfilename yourmapfilename.xml
3. Set the mapping file in the symbol table for the server using the ingsetenv command, as follows:
ingsetenv II_UNICODE_CONVERTER yourmapfilename
To check that the value is set correctly, run:
ingprenv II_UNICODE_CONVERTER
4. If you have remote clients connecting to this server and will be using the encoding for which you have created the custom mapping table, then copy the compiled mapping file to all clients in the directory $II_SYSTEM\ingres\files\ucharmaps. Also ensure that you have set II_UNICODE_CONVERTER to your custom converter in the symbol table for the clients.