Lua 處理 UTF-8 字串
Posted on Mon 17 October 2016 in note • Tagged with lua, utf8
最近要用 Lua 處理 UTF-8 字串,但是 Lua 到了 5.3 才開始支援 UTF-8。
UTF-8 字串長度及複製
我的需求很簡單,只要判斷字串長度及類似 strncpy …
Continue reading
Posted on Mon 17 October 2016 in note • Tagged with lua, utf8
最近要用 Lua 處理 UTF-8 字串,但是 Lua 到了 5.3 才開始支援 UTF-8。
我的需求很簡單,只要判斷字串長度及類似 strncpy …
PIL 7.3 – Stateless Iterators 中有提到
ipairs, which iterates over all elements in an array, as illustrated next
及
The pairs function, which iterates over all elements in a table
也就是說 ipairs
是遍歷 array (Lua 中以數字為 index 的 …