Roxen.git / server / modules / filesystems / filesystem.pike

version» Context lines:

Roxen.git/server/modules/filesystems/filesystem.pike:413: Inside #if undefined(__NT__)
  #ifndef __NT__    if( String.width( p ) != 8 )    p = string_to_utf8( p );   #else    while( strlen(p) && p[-1] == '/' )    p = p[..strlen(p)-2];   #endif    return p;   }    + //! Convert from filesystem encoding. + string decode_path(string p) + { + #ifdef __NT__ +  // The filesystem on NT uses wide characters. +  return p; + #else +  // While filesystems on other OSes typically are 8bit. +  switch(lower_case(path_encoding)) { +  case "iso-8859-1": +  return p; +  case "utf8": case "utf-8": +  // NB: We assume that the filesystem will normalize +  // the path as appropriate. +  return Unicode.normalize(utf8_to_string(p), "NFC"); +  default: +  return Charset.decoder(path_encoding)->feed(p)->drain(); +  } + #endif /* !__NT__ */ + } +    string real_path(string f, RequestID id)   {    f = normalized_path + f;    if (FILTER_INTERNAL_FILE(f, id)) return 0;    catch {    f = NORMALIZE_PATH(encode_path(f));    if (has_prefix(f, normalized_path) ||   #ifdef __NT__    (f+"\\" == normalized_path)   #else /* !__NT__ */