src/rtlib/utf_convto_wchar.c
/* Convert a NUL-terminated UTF string to FB_WCHARs.
   dst is an output buffer, or NULL to allocate a new one.
   If dst is not NULL, then *chars is the length of the output buffer in
   characters. If it's too short then no trailing NUL character is appended!
   Returns the output buffer and sets *chars to the number of wchars written
   to the buffer, NOT including any trailing NUL, and counting UTF16 surrogate
   pairs (if WCHAR is 16 bit) as 2. */
Convert a NUL-terminated UTF string to FB_WCHARs.
dst is an output buffer, or NULL to allocate a new one.
If dst is not NULL, then *chars is the length of the output buffer in
characters. If it's too short then no trailing NUL character is appended.
Returns the output buffer and sets *chars to the number of wchars written
to the buffer, NOT including any trailing NUL, and counting UTF16 surrogate
pairs (if WCHAR is 16 bit) as 2.
Convert a NUL - terminated UTF string to FB_WCHARs . dst is an output buffer or NULL to allocate a new one . If dst is not NULL then * chars is the length of the output buffer in characters . If it ' s too short then no trailing NUL character is appended . Returns the output buffer and sets * chars to the number of wchars written to the buffer NOT including any trailing NUL and counting UTF16 surrogate pairs ( if WCHAR is 16 bit ) as 2 .
FB_WCHAR *fb_UTFToWChar( FB_FILE_ENCOD encod, const void *src, FB_WCHAR *dst, ssize_t *chars )
{
	switch( encod )
	{
	case FB_FILE_ENCOD_UTF8:
		return hUTF8ToWChar( src, dst, chars );
	case FB_FILE_ENCOD_UTF16:
		return hUTF16ToWChar( src, dst, chars );
	case FB_FILE_ENCOD_UTF32:
		return hUTF32ToWChar( src, dst, chars );
	default:
		return NULL;
	}
}
FB_WCHAR * fb_UTFToWChar ( FB_FILE_ENCOD encod , const void * src , FB_WCHAR * dst , ssize_t * chars ) { switch ( encod ) { case FB_FILE_ENCOD_UTF8 : return hUTF8ToWChar ( src , dst , chars ) ; case FB_FILE_ENCOD_UTF16 : return hUTF16ToWChar ( src , dst , chars ) ; case FB_FILE_ENCOD_UTF32 : return hUTF32ToWChar ( src , dst , chars ) ; default : return NULL ; } }
Convert a NUL-terminated UTF string to FB_WCHARs.
Convert a NUL - terminated UTF string to FB_WCHARs .