FreeBASIC  0.91.0
strw_convto_str.c
Go to the documentation of this file.
1 /* unicode to ascii string convertion function */
2 
3 #include "fb.h"
4 
6 {
7  FBSTRING *dst;
8  ssize_t chars;
9 
10  if( src == NULL )
11  return &__fb_ctx.null_desc;
12 
13  chars = fb_wstr_Len( src );
14  if( chars == 0 )
15  return &__fb_ctx.null_desc;
16 
17  dst = fb_hStrAllocTemp( NULL, chars );
18  if( dst == NULL )
19  return &__fb_ctx.null_desc;
20 
21  fb_wstr_ConvToA( dst->data, src, chars );
22 
23  return dst;
24 }