Forget my post, dirent.d_name is already uf-8. I had a bug in my program caused by a fact that sizeof(dirent) is 1 (the d_name is declared as array of size 1) but in reality fl_scandir() allocates enough space for dirent to accommodate the whole string.
Sorry, R. On 14/06/2012 17:55, Roman Kantor wrote: > It says that fl_filename_list() supposed to be a "portable" version of > scandir. > To me it seems that the first parameter is utf8-aware, but on windows > fl_filename_list() just returns some mess in d_name - maybe wchar_t wide > strings? > Is it correct to use fl_utf8fromwc() upon d_name field (on windows) to get > correct utf-8 names? > Maybe it would be useful to have a portable wrapper function (even thread > non-safe with a static internal buffer, it seem to me that many utf-8 > functions are > not thread safe anyway) which would return utf-8 names, something like > > const char * fl_filename(const dirent *); > > or thread-safe (but with unnecessary copying on some platforms) > > int fl_filename(char * utf8_buffer, int buf_len, const dirent *); > > and possibly other wrappers to get additional portable info from dirent. > > > Thanks, > > R. > _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

