Browse Source

textinput mentions utf8 library;

bjorn 1 year ago
parent
commit
36eacf0741
2 changed files with 4 additions and 4 deletions
  1. 1 1
      api/init.lua
  2. 3 3
      api/lovr/callbacks/textinput.lua

+ 1 - 1
api/init.lua

@@ -815,7 +815,7 @@ return {
       description = "This callback is called when text has been entered.\n\nFor example, when `shift + 1` is pressed on an American keyboard, `lovr.textinput` will be called with `!`.",
       description = "This callback is called when text has been entered.\n\nFor example, when `shift + 1` is pressed on an American keyboard, `lovr.textinput` will be called with `!`.",
       key = "lovr.textinput",
       key = "lovr.textinput",
       module = "lovr",
       module = "lovr",
-      notes = "Some characters in UTF-8 unicode take multiple bytes to encode.  Due to the way Lua works, the length of these strings will be bigger than 1 even though they are just a single character. `Pass:text` is compatible with UTF-8 but doing other string processing on these strings may require a library.  Lua 5.3+ has support for working with UTF-8 strings.",
+      notes = "Some characters in UTF-8 unicode take multiple bytes to encode.  Due to the way Lua works, the length of these strings will be bigger than 1 even though they are just a single character.  The `utf8` library included with LÖVR can be used to manipulate UTF-8 strings.  `Pass:text` will also correctly handle UTF-8.",
       related = {
       related = {
         "lovr.keypressed",
         "lovr.keypressed",
         "lovr.keyreleased"
         "lovr.keyreleased"

+ 3 - 3
api/lovr/callbacks/textinput.lua

@@ -21,9 +21,9 @@ return {
   },
   },
   notes = [[
   notes = [[
     Some characters in UTF-8 unicode take multiple bytes to encode.  Due to the way Lua works, the
     Some characters in UTF-8 unicode take multiple bytes to encode.  Due to the way Lua works, the
-    length of these strings will be bigger than 1 even though they are just a single character.
-    `Pass:text` is compatible with UTF-8 but doing other string processing on these strings may
-    require a library.  Lua 5.3+ has support for working with UTF-8 strings.
+    length of these strings will be bigger than 1 even though they are just a single character.  The
+    `utf8` library included with LÖVR can be used to manipulate UTF-8 strings.  `Pass:text` will
+    also correctly handle UTF-8.
   ]],
   ]],
   returns = {},
   returns = {},
   related = {
   related = {