
    //! Get the file or directory attributes with support for UTF-8 paths (Windows only).
#if cimg_OS==2
    inline DWORD win_getfileattributes(const char *const path) {
      DWORD res = GetFileAttributesA(path);
      if (res==INVALID_FILE_ATTRIBUTES) {
        // Try alternative method, with wide-character string.
        int err = MultiByteToWideChar(CP_UTF8,0,path,-1,0,0);
        if (err) {
          CImg<wchar_t> wpath((unsigned int)err);
          if (MultiByteToWideChar(CP_UTF8,0,path,-1,wpath,err)) res = GetFileAttributesW(wpath);
        }

     
#if cimg_OS==2
    inline DWORD win_getfileattributes(const char *const path) {
      DWORD res = GetFileAttributesA(path);
      if (res==INVALID_FILE_ATTRIBUTES) {
         
        int err = MultiByteToWideChar(CP_UTF8,0,path,-1,0,0);
        if (err) {
          CImg<wchar_t> wpath((unsigned int)err);
          if (MultiByteToWideChar(CP_UTF8,0,path,-1,wpath,err)) res = GetFileAttributesW(wpath);
        }