Let me explain my issue with an example:
local Character = utf8.char(1114111) --Example UTF8 character
local A,B,C,D = Character:byte(1, -1)
print(A,B,C,D) -- 244 143 191 191
How can I convert "244 143 191 191" back to "1114111"?
The utf8.codepoint function takes a byte array as a string and converts it into a sequence of codepoints, with each return value being a separate codepoint. So you just have to convert those four values into a string for use by utf8.codepoint. string.char(A, B, C, D) would do it adequately.
utf8.codepoint(string.char(table.unpack{A, B, C, D}))