# Utf8ToUtf8(byte*, int, byte*, out int, int)

> Copies UTF-8 characters from one buffer to another.

## Definition

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

## Utf8ToUtf8(byte\*, int, byte\*, int, int)

```csharp
public static ConversionError Utf8ToUtf8(byte* srcBuffer, int srcLength, byte* destBuffer, out int destLength, int destCapacity)
```

### Parameters

**** (\[byte\*]\(https\://learn.microsoft.com/dotnet/api/system.byte)): The source buffer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of bytes to read from the source.**** (\[byte\*]\(https\://learn.microsoft.com/dotnet/api/system.byte)): The destination buffer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Outputs the number of bytes written to the destination.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The size in bytes of the destination buffer.

### Returns

| Type                                                                                    | Description                                                                                                                                                                                                                                                  |
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [ConversionError](/engine/6000.7/script-reference/unity/collections/conversionerror.md) | [ConversionError.None](/engine/6000.7/script-reference/unity/collections/conversionerror/none.md) if the copy fully completes. Otherwise, returns [ConversionError.Overflow](/engine/6000.7/script-reference/unity/collections/conversionerror/overflow.md). |

### Remarks

Assumes the source data is valid UTF-8.
