---
title: "System::Text::Unicode::Utf8::IsValid method"
url: "https://reference.aspose.com/pdf/cpp/system.text.unicode/utf8/isvalid/"
product: "Aspose.PDF for C++ API Reference"
description: "System::Text::Unicode::Utf8::IsValid method. Returns true if the provided span contains a valid UTF-8 sequence in C++."
---

## Utf8::IsValid method


Returns true if the provided span contains a valid UTF-8 sequence.

```cpp
static bool System::Text::Unicode::Utf8::IsValid(ReadOnlySpan<uint8_t> buffer)
```


| Parameter | Type | Description |
| --- | --- | --- |
| buffer | ReadOnlySpan\<uint8_t\> | The UTF-8 bytes to validate. |

### ReturnValue

true if the sequence is valid UTF-8; otherwise, false.

## See Also

* Class [ReadOnlySpan](../../../system/readonlyspan/)
* Class [Utf8](../)
* Namespace [System::Text::Unicode](../../)
* Library [Aspose.PDF for C++](../../../)
