(0000704)
|
Falk Reichbott
|
2014-11-27 08:18
(edited on: 2014-11-27 08:31) |
|
Available with version 5.1.2
Description
This module provides a libiconv conform interface for memory to memory character conversion. All special feature of the FLUC character conversion module are provided over 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 the linux like ICONV utility (fliconv) based on this library.
The open function supports encoding strings and CCSIDS. The fliconv_list() function provides all supported CCSIDs, CHARSETs and the corresponding encoding strings. If the compiler switch FICONV defined, then all the 'fliconv' entries are also available as 'iconv' functions. Means to port your existing code you must simply replace:
-#include<iconf.h>
+#define FICONV
+#include"FLCICV.h"
With this replacement you can re-build your source. To use the special features you must extent our encoding strings specifications.
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
//TOUESR - 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 free defined user table text file
//REPORT['('[file_name]')'] - Write a report file [STDERR]
Current supported system transliteration table:
ICONV - Transliteration table of libiconv
Current supported user table module names:
CCUTNPAS - UCS subset for String-Latin (XOEV/NPA)
CCUTSPEA - UCS subset for SEPA (all valid UTF-8 character < 128)
CCUTDELA - UCS subset of IBM1141, CP1252 and ISO8859-15
CCUTDLAX - UCS Subset of IBM1141, CP1252, ISO8859-15 and XOEF
For more information about free defined user table text file please refer to the FLCL user manual.
Advantage to normal iconv implementations:
- Support of encoding string and CCSIDs, list supported CCSIDs and Encoding strings
- EBCDIC New Line (0x15) to Line Feed (0x0A) management
- Subset support (String.Latin, SEPA, ...) and free defined user tables
- Recursive mapping and transliteration ('U:'->'UE')
- Case mapping, comprehensive reporting, byte order change handling
- A little bit faster and less memory and CPU consumption
Differences to the normal iconv:
- Use more errno's (mainly for user table parsing and such things, not for conversion it self)
- E2BIG is set if the output buffer smaller then the input data multiplied by the provided expansion factor -> No data is converted if the output buffer to small (increase performance significantly)
- More 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 defined in the TO string
- The list function get encoding string, the CCSID and the corresponding CHARSET (UTF/ASCII/EBCDIC) information
For additional information please refer to the interface specification in the Download area.
|
|