forceUnicode

From Bohemia Interactive Community
Revision as of 22:57, 25 February 2021 by Lou Montana (talk | contribs) (Add Leopard20's example)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Switches the mode of operation of the following commands to unicode:
forceUnicode usage with the argument 0 will also apply to called code.
Groups:
Strings

Syntax

Syntax:
forceUnicode mode
Parameters:
mode: Number - Mode of operation, can be:
  • -1 - off
  •  0 - on until end of script
  •  1 - on until next compatible command
Return Value:
Anything

Examples

Example 1:
copyToClipboard "д"; // Copies "д" to clipboard forceUnicode 1; copyToClipboard "д"; // Copies "д" to clipboard
Example 2:
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

Additional Information

See also:
copyToClipboardcopyFromClipboardselectcountininsertfindsplitString reverse

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note