文档

Unity Engine

Unity Engine

Utf16ToUtf8(char*, int, byte*, out int, int)

Copies UTF-16 characters from one buffer to another buffer as UTF-8.
阅读时间1 分钟最后更新于 1 个月前

Definition

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

Utf16ToUtf8(char*, int, byte*, int, int)

public static ConversionError Utf16ToUtf8(char* utf16Buffer, int utf16Length, byte* utf8Buffer, out int utf8Length, int utf8Capacity)

Parameters

utf16Buffer

The source buffer.

utf16Length

The number of chars to read from the source.

utf8Buffer

The destination buffer.

utf8Length

Outputs the number of bytes written to the destination.

utf8Capacity

The size in bytes of the destination buffer.

Returns

Type

Description

ConversionErrorConversionError.None if the copy fully completes. Otherwise, returns ConversionError.Overflow.

Remarks

Assumes the source data is valid UTF-16.