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

***

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

# Function: textEncode()

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

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

## Parameters

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

## Returns

`Uint8Array`

编码后的 `Uint8Array`

## Defined in

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