# LengthInUtf8Bytes()

> Returns the number of bytes required to encode this rune as UTF-8.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public int LengthInUtf8Bytes()
```

### Returns

| Type                                                       | Description                                                                                                                                      |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes required to encode this rune as UTF-8. If the rune's codepoint is invalid, returns 4 (the maximum possible encoding length). |
