forceUnicode: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) No edit summary |
Lou Montana (talk | contribs) m (Text replacement - "\|game([0-9]) ?= (.+) \|version([0-9]) ?= (.+) " to "|game$1= $2 |version$3= $4 ") |
||
Line 2: | Line 2: | ||
|game1= arma3 | |game1= arma3 | ||
|version1= 2.02 | |version1= 2.02 | ||
Revision as of 14:58, 3 May 2021
Description
- Description:
- Sets the Unicode flag which forces some of the string manipulation commands to switch to Unicode. The Unicode flag is always set right after forceUnicode command execution, but is reset depending on the command mode:
- 1 - the Unicode flag is reset right after any of the supported commands executed or the end of script, whichever comes earlier.
- 0 - the Unicode flag is reset at the end of the script.
List of the commands that work with forceUnicode: - Groups:
- Strings
Syntax
- Syntax:
- forceUnicode mode
- Parameters:
- mode: Number - 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
- 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, 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
Additional Information
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