aboutsummaryrefslogtreecommitdiff
path: root/utf8.lua
diff options
context:
space:
mode:
Diffstat (limited to 'utf8.lua')
-rw-r--r--utf8.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/utf8.lua b/utf8.lua
index 3db6642..72177c2 100644
--- a/utf8.lua
+++ b/utf8.lua
@@ -100,6 +100,10 @@ end
-- instead of bytes
function utf8sub (s, i, j)
j = j or -1
+
+ if i == nil then
+ return ""
+ end
local pos = 1
local bytes = string.len(s)