[**minigame-std**](../README.md)

***

[minigame-std](../README.md) / textEncode

# Function: textEncode()

```ts
function textEncode(data): Uint8Array
```

Defined in: [src/std/codec/mod.ts:12](https://github.com/JiangJie/minigame-std/blob/ff3594872b1efbdbc13aabe99588385e855b50dc/src/std/codec/mod.ts#L12)

将字符串数据编码为 `Uint8Array`

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `data` | `string` | 需要编码的字符串数据。 |

## Returns

`Uint8Array`

编码后的 `Uint8Array`
