Hi. I recently tried out gsub and figuring how it works, and I ran into a problem. I have a script like this
local charmap = {
["k"] = 'x',
["kh"] = 'x',
["c"] = 'k',
["c?"] = 'k',
["c!"] = 'k',
["ch"] = 'k',
["cq"] = 'k',
["t"] = 'c',
["tr"] = 'c',
["c"] = 'c',
["ch"] = 'c',
["d"] = 'z',
["g"] = 'z',
["gi"] = 'z',
["r"] = 'z',
["g"] = 'z',
["gi"] = 'z',
["gì"] = 'z',
["gí"] = 'z',
["g?"] = 'z',
["g?"] = 'z',
["g?"] = 'z',
["?"] = 'd',
["p"]= 'f',
["ph"]= 'f',
["n"] = 'q',
["ng"] = 'q',
["nh"] = 'q',
["n?"] = 'q',
["t"] = 'w',
["th"] = 'w'
}
print(string.gsub("tieng", ".", charmap))
but instead of printing "tieq", it prints "tieqw" (look at the character map for reference). Please fix it for me. Thanks in advance.

1 comment
is there a workaround for this ?