---
title: "stringRepresentation(encoding:)"
framework: wifiinfrastructure
role: symbol
role_heading: Instance Method
path: "wifiinfrastructure/wissid/stringrepresentation(encoding:)"
---

# stringRepresentation(encoding:)

Converts the SSID’s raw data to a string representation using the specified encoding.

## Declaration

```swift
func stringRepresentation(encoding: String.Encoding = .utf8) -> String?
```

## Parameters

- `encoding`: The text encoding to use for conversion. Defaults to UTF-8.

## Return Value

Return Value A string representation of the SSID, or nil if the raw data can’t be converted using the specified encoding.

## Discussion

Discussion Use this method to obtain a human-readable version of the network name. Because SSIDs don’t have a standardized text encoding, the conversion may fail if the raw data can’t be represented as text in the specified encoding. warning: Per the Wi-Fi standard, the SSID is a value between 1 and 32 bytes long, and not a String. No standard encoding is defined, and any byte value may appear, including embedded NULL characters, control characters, and other unprintable values.

## See Also

### Working with SSIDs as a string

- [init(_:encoding:)](wifiinfrastructure/wissid/init(_:encoding:).md)
