- To: Andre Pang <ozone@xxxxxxxxxxxxxxxx>
- Subject: [coders] Re: Converting a UTF-8 string to a wchar_t (in C)
- From: Andre Pang <ozone@xxxxxxxxxxxxxxxx>
- Date: Thu, 14 Dec 2006 17:19:34 +1100
- Cc: SLUG Coders <coders@xxxxxxxxxxx>
On 14/12/2006, at 1:15 AM, Andre Pang wrote:
2. Use the stupendously painful iconv() interface with a iconv_t
from "UTF-8" to "WCHAR_T".
For future reference, there's a file in the libiconv distribution's
extras/ directory named iconv_string.h (public domain licensed).
This gives a saner interface to iconv():
extern int iconv_string (const char* tocode,
const char* fromcode,
const char* start,
const char* end,
char** resultp,
size_t* lengthp);
(Of course, I only find out about this afterwards :).
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>