Topic: What kind of values does iconv( ) want?


Author: paal@imaker.no (=?ISO-8859-1?Q?P=E5l_R=F8nning?=)
Date: Fri, 9 May 2003 17:20:23 +0000 (UTC)
Raw View
I have an application that needs to translate a string from charsets
utf-8 to latin 1 (iso 8859-1).

According to the documentation of iconv.h, input variables to the
iconv()-function are

1) iconv_t,
2) char **,
3) size_t *,
4) char **,
5) size_t *


Arguments 1,2 and 4 are pretty obvious to me, but what should number 3
and 5 be, exactly? What kind of value does size_t hold?


Regards,
P   l R   nning

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: ron@sensor.com ("Ron Natalie")
Date: Fri, 9 May 2003 18:09:54 +0000 (UTC)
Raw View
"P   l R   nning" <paal@imaker.no> wrote in message news:d05d79b0.0305082249.3f167d3b@posting.google.com...
> I have an application that needs to translate a string from charsets
> utf-8 to latin 1 (iso 8859-1).
>
iconv isn't a standard C++ function.  It's from UNIX.
Try reading the documentation:
http://www.opennc.org/onlinepubs/7908799/xsh/iconv.html

They are pointers to the counts for the input and output buffers (in bytes).
They take the number of bytes to convert (*inbytesleft) and the size of
the availble output buffer (*outbytslef) when you call iconv.   It sets the
values to what actually got converted (both on input and output) when
the routine returns.


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]