In the struct dirent can the member d_name have characters that are unicode but not ascii? I tested and it works with ‘é’ but I’m not sure if that’s because ‘é’ is in ascii. What type is d_name, if it’s char then I’m hooped but if it’s wchar_t I’m saved.
In the struct dirent can the member d_name have characters that are unicode but
Share
The Open Group Base Specifications state that
struct direntshall have the following member of unspecified size:In conforming implementations it is of type
char[]but that doesn’t necessarily mean that it can’t store Unicode characters; the specification does not require the support of multiple character sets (or characters beyond the portable character set) but it doesn’t forbid it either ('é'by the way, is not in ASCII).In practice, the supported character set depends on your locale. In C terms, the string in
d_nameis stored as “multi byte” characters.