Roxen.git
/
server
/
etc
/
modules
/
Roxen.pmod
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/etc/modules/Roxen.pmod:6359:
//! is also logged in this case, unless @[no_warn] is nonzero. //! //! The given path is assumed to be absolute, and it is normalized //! with @[combine_path] before being checked. The returned paths //! always have "/" as directory separators. If there is a trailing //! slash then it is kept intact. //! //! If @[charset] is set then charset conversion is done: @[path] is //! assumed to be a (possibly wide) unicode string in NFC, and @[charset] is //! taken as the charset used in the file system. The returned path is
-
//! a unicode string as well. If @[charset] isn't specified then
no
-
//!
charset
conversion is done anywhere, which means that @[path] must
-
//! have
the
same
charset
as
the
file
system
, and the
case
insensitive
-
//!
comparisons
only
work in as far as @[lower_case] does the right
-
//! thing with that charset
.
+
//! a unicode string as well. If @[charset] isn't specified then
it
+
//!
and
the
filesystem
are
assumed
to
be
in
utf-8
, and the
result
will
+
//!
be
utf-8
encoded
.
//! //! If @[charset] is given then it's assumed to be a charset accepted //! by @[Charset]. If there are charset conversion errors in @[path] //! or in the file system then those paths are treated as nonexisting. //! //! @note //! Existing paths are cached without any time limit, but the cached //! paths are always verified to still exist before being reused. Thus //! the only overcaching effect that can occur is if the underlying //! file system is case insensitive and some path segment only has //! changed in case. { ASSERT_IF_DEBUG (is_absolute_path (path)); string cache_name = "case_insens_paths"; function(string:string) encode, decode; switch (charset && lower_case(charset)) { case 0:
-
+
// NB: NT has a filesystem that uses UTF-16.
+
#ifndef __NT__
+
return string_to_utf8(this_function(utf8_to_string(path), no_warn, "utf8"));
+
#endif
break; case "utf8": case "utf-8": encode = string_to_utf8; decode = utf8_to_string; cache_name += ":utf8"; break; default: Charset.Encoder enc = Charset.encoder (charset); Charset.Decoder dec = Charset.decoder (charset);