I am working with split with other language

i want this to work
2. What is the issue? Include screenshots / videos if possible!
well when i run the code it give me for each letter “�” insted of the letter itself

local text = "اهلا انا استاذ فرقان و اقدر اطبع لك اي صوره من اي مكان"
local LettersTable = string.split(text,"")
local str = ""
local textlable = game.StarterGui.Eye.Frame.Main.TextLabel
--local splitFunction = function(Str)
--	for _,Letter in #str do
--		print(Letter)
--	end
--end
print(text:split("")) 

– it will print � for each letter so like insted of “ا” it will print � how i could fix this
note this langauge is arabic

try and see if this will work. i have no promises.

local text = "اهلا انا استاذ فرقان و اقدر اطبع لك اي صوره من اي مكان"
local LettersTable = {}
for i = 1, #text do
    table.insert(LettersTable, text:sub(i, i))
end

local str = ""
local textLabel = game.StarterGui.Eye.Frame.Main.TextLabel

for _, letter in ipairs(LettersTable) do
    print(letter)
end

textLabel.Text = table.concat(LettersTable, "")

still sadlly but i guess thanks

i dont think split works with foreign languages besides eng, i guess u could try to separate it into two strings

also keep in mind arabic is written from right to left!

thanks i guess but it somehow work and doesnt work like if i want it to give me words insted of letters it work in that way like lua local text = "انا احب القطط" print(string.split(text,' '))
it will print every word like {انا,احب,القطط}

1 Like

the problem have something to do with UTF-8 i think

1 Like