---
name: "forceUnicode"
type: command
status: ok
groups: ["Strings"]
arma3_since: "2.02"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/forceUnicode
revid: 377708
updated: 2026-01-02T09:03:46Z
---

# forceUnicode

*Command · Strings · Arma 3 v2.02*

## Description

List of the commands that work with [forceUnicode](../commands/forceUnicode.md)
- [copyFromClipboard](../commands/copyFromClipboard.md)
- [copyToClipboard](../commands/copyToClipboard.md)
- [count](../commands/count.md)
- [find](../commands/find.md)
- [in](../commands/in.md)
- [insert](../commands/insert.md)
- [reverse](../commands/reverse.md)
- [select](../commands/select.md)
- [splitString](../commands/splitString.md)
- [trim](../commands/trim.md)
- [regexFind](../commands/regexFind.md)
- [regexMatch](../commands/regexMatch.md)
- [regexReplace](../commands/regexReplace.md)

Sets the Unicode flag which forces some of the string manipulation commands to switch to <https://en.wikipedia.org/wiki/Unicode>.
The Unicode flag is always set right after [forceUnicode](../commands/forceUnicode.md) command execution, but is reset depending on the command mode (see *[mode](../commands/forceUnicode.md#syntax-1)*).

When the flag is set it will also affect all scopes within the script including child scopes (see [diag_scope](../commands/diag_scope.md)).
There are many other string manipulation commands like [ctrlSetText](../commands/ctrlSetText.md), [getTextWidth](../commands/getTextWidth.md), etc. that support Unicode by design so no additional forcing is needed.

## Syntax

```sqf
forceUnicode mode
```

**Parameters:**

- `mode`: [Number](../topics/Number.md) - mode of operation, can be:
  - -1 - resets previously set Unicode flag
  -  0 - sets Unicode flag until the end of script
  -  1 - sets Unicode flag until after next supported command or until the end of script, whichever comes earlier

**Returns:** [Anything](../topics/Anything.md)

## Examples

### Example 1

```sqf
copyToClipboard "д"; // copies "Ð´" to clipboard
forceUnicode 1;
copyToClipboard "д"; // copies "д" to clipboard
```

### Example 2

```sqf
private _string = "привет";            // a string that uses Unicode characters
systemChat str count _string;        // 12 - the character count is wrong without forceUnicode

call {
    systemChat str count _string;    // 12 - identical result
    forceUnicode 0;
    systemChat str count _string;    // 6 - correct result
};

systemChat str count _string;        // 6 - outer scope is affected by forceUnicode as well, because the command mode is 0

forceUnicode -1; // cancelled

call {
    systemChat str count _string;    // 12 - wrong count
    forceUnicode 1;
    systemChat str count _string;    // 6 - correct result, but Unicode it reset after this operation, because command mode is 1
};

systemChat str count _string;        // 12 - outer scope is not affected as it was reset right after count
```

## See also

[copyToClipboard](../commands/copyToClipboard.md) · [copyFromClipboard](../commands/copyFromClipboard.md) · [select](../commands/select.md) · [count](../commands/count.md) · [in](../commands/in.md) · [insert](../commands/insert.md) · [find](../commands/find.md) · [splitString](../commands/splitString.md) · [reverse](../commands/reverse.md)

<sub>Source: [BI Community Wiki — forceUnicode](https://community.bistudio.com/wiki/forceUnicode) (revision 377708).</sub>
