Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Utf8ToUcs(out Rune, byte*, ref int, int)

Reads a UTF-8 encoded character from a buffer.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

Utf8ToUcs(Rune, byte*, int, int)

public static ConversionError Utf8ToUcs(out Unicode.Rune rune, byte* buffer, ref int index, int capacity)

Parameters

rune

Outputs the character read. If the read fails, outputs Unicode.ReplacementCharacter.

buffer

The buffer of bytes to read.

index

Reference to a byte index into the buffer. If the read succeeds, index is incremented by the size in bytes of the character read. If the read fails, index is incremented by 1.

capacity

The size in bytes of the buffer. Used to check that the read is in bounds.

Returns

Type

Description

ConversionErrorConversionError.None if the read succeeds. Otherwise, returns ConversionError.Overflow or ConversionError.Encoding.