# SetTextUtf8(ReadOnlySpan<byte>)

> Sets the text content from a UTF-8 encoded byte sequence without allocating a managed string.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public void SetTextUtf8(ReadOnlySpan<byte> utf8)
```

### Parameters

**** (\[ReadOnlySpan\<byte>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The UTF-8 encoded bytes to set as the element's text content.

### Remarks

This method is slower than its UTF-16 counterparts since transcoding is unavoidable. Prefer using [TextElement.SetText](/engine/6000.7/script-reference/unityengine/uielements/textelement/settext.md) when possible.
