# sm.util.utf8StringLength

Returns the number of UTF-8 characters in a string.

**Kind:** Function

**Environments:** Game, Terrain

## Game

``` { .lua .api-signature }
sm.util.utf8StringLength( string )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.util.md#utf8stringlength)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `string` | string | The input string. |

**Returns:**

| Type | Description |
| --- | --- |
| integer | The number of UTF-8 characters. |

## Terrain

``` { .lua .api-signature }
sm.util.utf8StringLength( string )
```

[Open the full Terrain reference](../Terrain-Script-Environment/Static-Functions/sm.util.md#utf8stringlength)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `string` | string | The input string. |

**Returns:**

| Type | Description |
| --- | --- |
| integer | The number of UTF-8 characters. |
