1

Please help

I'm trying to send arabic text to array of arabic letters using string.gmatch in corona sdk so please help to do it right

local lArray={}
local t="من جد وجد ومن زرع حصد"
for value in string.gmatch(t,".") do 
lArray [index] = value
print(value)
index = index + 1
end

The output is this character

2013-12-25 22:48:01.337 Corona Simulator[4878:507] Ù
2013-12-25 22:48:01.337 Corona Simulator[4878:507] …
2013-12-25 22:48:01.337 Corona Simulator[4878:507] Ù
2013-12-25 22:48:01.338 Corona Simulator[4878:507] †

appreciate your help


I found this solution in this post here

Community
  • 1
  • 1
Mil
  • 11
  • 2
  • [I found this solution it helped me to resolve the issue ][1] [1]: http://stackoverflow.com/questions/13235091/extract-the-first-letter-of-a-utf-8-string-with-lua – Mil Dec 30 '13 at 17:00

2 Answers2

0

Unless Corona has added it, pattern matching in Lua does nor support Unicode.

lhf
  • 70,581
  • 9
  • 108
  • 149
0

You can use utf8 plugin https://docs.coronalabs.com/plugin/utf8/index.html

string.gmatch( s, pattern )

s:gmatch( pattern )
Arash
  • 3,013
  • 10
  • 52
  • 74