[fs.path.type.cvt]

# 31 Input/output library [[input.output]](./#input.output)

## 31.12 File systems [[filesystems]](filesystems#fs.path.type.cvt)

### 31.12.6 Class path [[fs.class.path]](fs.class.path#fs.path.type.cvt)

#### 31.12.6.3 Conversions [[fs.path.cvt]](fs.path.cvt#fs.path.type.cvt)

#### 31.12.6.3.2 Type and encoding conversions [fs.path.type.cvt]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14013)

The [*native encoding*](#def:native_encoding "31.12.6.3.2 Type and encoding conversions [fs.path.type.cvt]") of an ordinary character string is
the operating system dependent current encoding
for pathnames ([[fs.class.path]](fs.class.path "31.12.6 Class path"))[.](#1.sentence-1)

The [*native encoding*](#def:native_encoding "31.12.6.3.2 Type and encoding conversions [fs.path.type.cvt]") for wide character strings is
the implementation-defined execution
wide-character set encoding ([[character.seq]](character.seq "16.3.3.3.4 Character sequences"))[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14021)

For member function arguments that take character sequences representing
paths and for member functions returning strings, value type and encoding
conversion is performed if the value type of the argument or return value differs frompath​::​value_type[.](#2.sentence-1)

For the argument or return value, the method of conversion and the encoding
to be converted to is determined
by its value type:

- [(2.1)](#2.1)

  char: The encoding is the native ordinary encoding[.](#2.1.sentence-1)
  The method of conversion, if any, is operating system dependent[.](#2.1.sentence-2)
  [*Note [1](#note-1)*:
  For POSIX-based operating systems path​::​value_type is char so no conversion from char value type arguments or to char value type return values is performed[.](#2.1.sentence-3)
  For Windows-based operating systems, the
native ordinary encoding is determined by calling a Windows API function[.](#2.1.sentence-4)
 â *end note*]
  [*Note [2](#note-2)*:
  This results in behavior identical to other C and C++
standard library functions that perform file operations using ordinary character
strings to identify paths[.](#2.1.sentence-5)
  Changing this behavior would be surprising and
error-prone[.](#2.1.sentence-6)
 â *end note*]

- [(2.2)](#2.2)

  wchar_t: The encoding is the native wide encoding[.](#2.2.sentence-1)
  The method of conversion is unspecified[.](#2.2.sentence-2)
  [*Note [3](#note-3)*:
  For Windows-based operating systems path​::​value_type is wchar_t so no conversion from wchar_t value type arguments or to wchar_t value type return values is performed[.](#2.2.sentence-3)
 â *end note*]

- [(2.3)](#2.3)

  char8_t: The encoding is UTF-8[.](#2.3.sentence-1)
  The method of conversion
is unspecified[.](#2.3.sentence-2)

- [(2.4)](#2.4)

  char16_t: The encoding is UTF-16[.](#2.4.sentence-1)
  The method of conversion
is unspecified[.](#2.4.sentence-2)

- [(2.5)](#2.5)

  char32_t: The encoding is UTF-32[.](#2.5.sentence-1)
  The method of conversion
is unspecified[.](#2.5.sentence-2)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L14066)

If the encoding being converted to has no representation for source
characters, the resulting converted characters, if any, are unspecified[.](#3.sentence-1)

Implementations should not modify member function arguments
if already of type path​::​value_type[.](#3.sentence-2)
