+
+#ifdef HAVE_MBSTOWCS
+ wchar_t *cstr;
+ size_t clen = strlen(text)+1;
+ cstr = malloc(sizeof(wchar_t) * clen); /* yes we are allocating probably too much here, I know */
+ string->count=mbstowcs(cstr,text,clen);
+ if ( string->count == -1){
+ string->count=mbstowcs(cstr,"Enc-Err",6);
+ }
+#else
+ char *cstr = strdup(text);
+ string->count = strlen (text);
+#endif
+