mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-04-23 15:45:18 +02:00
Clarify pcall usage and ustring_to_line_array behavior
This commit is contained in:
parent
8374270831
commit
f8d4b994ff
2 changed files with 2 additions and 0 deletions
|
@ -44,6 +44,7 @@ _UTF-8 strings_, or _u-strings_ for short.
|
|||
* Converts a u-string to string. Used for displaying text in sign formspec
|
||||
* `mcl_signs.ustring_to_line_array(ustr)`
|
||||
* Converts a u-string to line-broken list of u-strings aka _a line array_
|
||||
* Behavior on line overflow is controlled by the `mcl_signs_wrap_mode` enum
|
||||
* `mcl_signs.generate_line(ustr, ypos)`
|
||||
* Generates a texture string from a u-string for a single line using the
|
||||
character map
|
||||
|
|
|
@ -167,6 +167,7 @@ local function string_to_ustring(str, max_characters)
|
|||
|
||||
local ustr = {}
|
||||
|
||||
-- pcall wrapping to protect against invalid UTF-8
|
||||
local iter = utf8.codes(str)
|
||||
while true do
|
||||
local success, i, code = pcall(iter)
|
||||
|
|
Loading…
Add table
Reference in a new issue