This module contains the Citrus iconv implementation in a modified version adapted for use in DCMTK and with the character set encodings used in the DICOM standard.
The most important functions are:
Examples
The following example shows a very simple character set conversion. Most error handling code has been omitted for brevity.
if (id != OFreinterpret_cast(iconv_t, -1))
{
char output[20];
char input[20];
strcpy(input, "J\xF6rg");
char *src_ptr = input;
size_t src_len = std::strlen(src_ptr);
char *dst_ptr = output;
size_t dst_len = 20;
size_t result =
OFiconv(
id, &src_ptr, &src_len, &dst_ptr, &dst_len);
if (result != OFstatic_cast(size_t, -1))
{
std::cout << "UTF-8 string: " << output << std::endl;
}
}
DCMTK_OFICONV_EXPORT size_t OFiconv(iconv_t cd, char **src, size_t *srcleft, char **dst, size_t *dstleft)
convert the string in the buffer *src of length *srcleft bytes and stores the converted string in the...
DCMTK_OFICONV_EXPORT int OFiconv_close(iconv_t cd)
close the specified converter cd
BEGIN_EXTERN_C DCMTK_OFICONV_EXPORT iconv_t OFiconv_open(const char *dstname, const char *srcname)
open a converter from the codeset srcname to the codeset dstname and returns its descriptor.