Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:StringToWString

From RoR Wiki
Revision as of 19:49, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Interface functions
Version: WAR 1.4.8

Converts an ordinary Lua string to a wide string.

wideText = StringToWString(text)

Arguments

text
string – The string to convert.

Returns

wideText
wstring – The converted string.

Details

  • Each byte of text becomes one wide character with the same value. This is correct for ASCII. Multi-byte UTF-8 sequences are not decoded: each of their bytes becomes a separate character.
  • The conversion stops at the first zero byte.
  • text must be a string; a number or a wide string raises the generic Invalid Parameters message and the function returns nothing.
  • Exactly one argument must be passed.

Errors

None besides the generic Invalid Parameters message.

Example

A minimal call built from the signature:

LabelSetText( "MyLabel", StringToWString( "Hello" ) )

See also