Hello,

can i use wcstombs(3) to convert a string presented in utf8 into
current locale? basically i'm looking for something like iconv from
ports but included into base system.

in other words, would something like this work?

char *locale, dst[256];
size_t len;

locale = setlocale(LC_CTYPE, "");
if (locale == NULL)
  /* bail */

len = wcstombs(dst, (wchar_t *) src, sizeof(dst));
if (len < 0)
  /* bail */

printf("%*.*s\n", len, len, dst);

thanks,
max
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to