---
title: "transcode(_:from:)"
framework: swift
role: symbol
role_heading: Type Method
path: "swift/unicode/utf8/transcode(_:from:)"
---

# transcode(_:from:)

Converts a scalar from another encoding’s representation, returning nil if the scalar can’t be represented in this encoding.

## Declaration

```swift
static func transcode<FromEncoding>(_ content: FromEncoding.EncodedScalar, from _: FromEncoding.Type) -> Unicode.UTF8.EncodedScalar? where FromEncoding : _UnicodeEncoding
```

## Discussion

Discussion A default implementation of this method will be provided automatically for any conforming type that does not implement one.
