Character encoding and forbidden characters in strings

ok, i don’t even know where to start. lets say i want to do something i shouldn’t. i want to use this string:

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~▒€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ

seems like it rendered here correctly.

obviously, i can’t use it as it is, since it contains all the forbidden magical characters lua expects you to escape, including escape character.
so, the dumb solution is to put that string into separate file.
i thought there might be some way to include it in the script in some byte form or something. i don’t know, external file it is.

HERE’S THE PROBLEM: external file isn’t particularly working either.
to be specific, it works perfectly for first 95 characters. number 96 is this block: .

what i’m doing is straightforward:

function chars_to_tiles(txt_in, charset) --write 
	local tiles = {} 
	for i = 1, #txt_in do
		for n = 1, #charset do
			if txt_in:sub(i,i) == charset:sub(n,n) then 
				tiles[i] = n
			end 
		end 
	end 
	return tiles
end 

and then i pass the tiles table as textiles and use it to place actual tiles:

for n = 1, #textiles do
	local pxl = tilemap:putPixel(n-1+pos_x, pos_y, textiles[n]) 
end 

however, at char 96 i get tile number 161:

and then 269 and 261:

that didn’t make sense, so i looked closely at the sequence in notepad++.
there’s a col and pos value and for the first line those values should be the same. and they are, for 95 characters! at col 97 pos is 99 - so two more. i guess that means something.
the file is saved as utf-8. i don’t see any hidden characters. but i do see 352 positions for 215 columns.
it doesn’t matter the numbers here and those of placed tiles don’t match, this doesn’t seem right.

so the obvious question is: what is going on and how can i fix it?

also: if user inputs non-english characters in script’s text field, are they going to be in utf-8 or some system specific encoding?