FLUC iconv Interface

This module provides a libiconv-compatible interface for memory to memory character conversion. All special features of the FLUC character conversion module are provided through the TO and FROM string specification in fliconv_open() function.

iconvlist(NULL,NULL);
h=iconv_open("UTF16LE//BOM","1141//ELF2NL//IGNORE//TRANSLIT//REPORT(report.txt)");
r=iconv(h,&inDat,&inLen,&outDat,&outLen);
iconv_close(h);

Please have a look at the FLICONV.c sample file which implements a command line character conversion utility very similar to Linux' iconv utility (fliconv) based on this library in C. This DLL can also be used with COBOL on mainframes. We also provide a sample program in COBOL which converts an PS-FB80 dataset from IBM1141 to a PS-VB244 dataset with UTF-8.

The open function supports encoding strings and CCSIDS. The fliconv_list() function provides all supported CCSIDs, CHARSETs and the corresponding encoding strings. If you need a deticated code page (like DIN-66003, which we have allready provided as CCSID 66003 and as the alias DE-ASCII) please open an issue for it. All code pages and features are available on all supported platforms of FLAM.

If the compiler switch FICONV is defined, then all fliconv* entries are also available as iconv* functions. I.e. to port your existing code you must simply replace:

-#include<iconv.h>
+#define  FICONV
+#include"FLCICV.h"

With this replacement you can re-build your source. To use the special features you must append one or more of the encoding string specifications below.

Input encoding string enhancements:

  • //BOM - Manage byte order change
  • //ENL2LF - Convert EBCDIC new line (0x15) to line feed (0x0A)

Output encoding string enhancements:

  • //BOM - Write byte order mark
  • //ELF2NL - Convert EBCDIC line feed (0x0A) to new line (0x15)
  • //TOUPPER - Upper case mapping
  • //TOLOWER - Lower case mapping
  • //TOSUPPER - Special upper case mapping
  • //TOSLOWER - Special lower case mapping
  • //TOFOLD - Special case folding
  • //TOUSER - User table/module defined case mapping
  • //IGNORE - Ignore invalid characters
  • //TRANSLIT['('[systab]')'] - Transliterate invalid characters [ICONV]
  • //SUBSTITUTE['('[codepoint_list]')'] - Substitute invalid characters [0x1A]
  • //USRMOD'('module_name')' - Use a predefined user table module
  • //USRTAB'('file_name')' - Use a custom user table text file
  • //REPORT['('[file_name]')'] - Write a report file [STDERR]
  • //NFD Normalisation Form D (Canonical Decomposition)
  • //NFC Normalisation Form D (Canonical Decomposition, followed by Canonical Composition)
  • //COMBINED Character conversion with combined character support

 Currently supported system transliteration table:

  • ICONV - Transliteration table of libiconv

Currently supported user table module names:

  • CCUTNPAS - UCS subset for String-Latin (XOEV/NPA, with best fit mapping and case folding)
  • CCUTSPEA - UCS subset for SEPA (all valid UTF-8 character < 128, with transliteration)
  • CCUTDELA - UCS subset of IBM1141, CP1252 and ISO8859-15 (only CP check)
  • CCUTDLAX - UCS Subset of IBM1141, CP1252, ISO8859-15 and XÖV (only CP check)

For more information about custom user table text files (CCUTNPAS.txt) please refer to the FLCL user manual.You can define our own user table text file and if anything works fine we can provide the corresponding load module, shared object or DLL for it.

Improvements compared to standard iconv implementations:

  • Support of encodings string and CCSIDs, list supported CCSIDs and encoding strings
  • EBCDIC New Line (0x15) to Line Feed (0x0A) management
  • Subset support (String.Latin, SEPA, ...) and custom user tables
  • Recursive n to m mapping and transliteration ('U:'->'UE')
    • Allows tagging / entry help
    • Powerful combined character support
    • NFD/NFC mappings 
  • Case mapping, comprehensive reporting, byte order change handling
  • Reads 5 and 6 byte UTF-8 encoded characters (values with preceding zeros)
  • Slightly faster and less memory and CPU consumption

Differences to the standard iconv library:

  • Supports more errno values (mainly for user table parsing, not for conversion itself)
  • E2BIG is set if the output buffer is smaller than the input data multiplied by the provided expansion factor. No data is converted if the output buffer is too small (increases performance significantly).
  • Functions to provide about, version, license, statistic, error and other information
  • Byte order mark is only printed to the output file if the BOM keyword is specified in the TO string
  • The list function gets available encoding strings, the CCSID and the corresponding CHARSET (UTF/ASCII/EBCDIC) information

For additional information please refer to the interface specification in the Download area.