summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/luat-uni.lua
blob: 06945ed2babe55a8cedfcd258b967f25bd348a22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- filename : luat-uni.lua
-- comment  : companion to luat-uni.tex
-- author   : Hans Hagen, PRAGMA-ADE, Hasselt NL
-- copyright: PRAGMA ADE / ConTeXt Development Team
-- license  : see context related readme files

if not versions then versions = { } end versions['luat-uni'] = 1.001

function unicode.utf8.split(str)
    lst = { }
 -- for snippet in unicode.utf8.gfind(str,".") do
    for snippet in string.utfcharacters(str) do
        table.insert(lst,snippet)
    end
    return lst
end

function unicode.utf8.each(str,fnc)
 -- for snippet in unicode.utf8.gfind(str,".") do
    for snippet in string.utfcharacters(str) do
        fnc(snippet)
    end
end