---
title: "init(decoding:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/string/init(decoding:)-364r2"
---

# init(decoding:)

On Unix, creates the string "/"

## Declaration

```swift
init(decoding root: FilePath.Root)
```

## Parameters

- `root`: The path root to be interpreted as CInterop.PlatformUnicodeEncoding.

## Discussion

Discussion On Windows, creates a string by interpreting the path root’s content as UTF-16. If the content of the path root isn’t a well-formed Unicode string, this initializer replaces invalid bytes with U+FFFD. This means that on Windows, conversion to a string and back to a path root might result in a value that’s different from the original path root.
