I have no problem on other unicode strings like “é”
but whenever I use another language that returns a unicode “光” it returns as is, it doesn’t return a text that I desire which is “光”,
If I manually input “光” in my code, it will automatically displayed, but all of my chinese char’s are sent to me by a unicode, I hope you understand my question
Let me re-ask the question, are you using network.request() or network.download() to get the file? Can you post your code you’re using to fetch the file?
local function networkListener( event ) if ( event.isError ) then print( "Network error!") else if event.phase == "began" then print("hello") elseif event.phase == "ended" then print("hi") myNewData = event.response -- print ("From server : "..myNewData) decodedData = (json.decode( myNewData)) SaveData() else end end end network.request( "The webserver site(JSON display only)", "GET", networkListener )
That looks like a URL-escaped string. It will work in a web-view, but not in a Corona text string. You’ll need to get that into UTF-8.
I was hoping that url.unescape() would work, but it didn’t, so unfortunately I’m not aware of anything that converts such escaped strings to UTF-8-characters in Corona.
Where does the Chinese text come from?
It would be best if the text in the file on the server was UTF-8 to begin with.
Let me re-ask the question, are you using network.request() or network.download() to get the file? Can you post your code you’re using to fetch the file?
local function networkListener( event ) if ( event.isError ) then print( "Network error!") else if event.phase == "began" then print("hello") elseif event.phase == "ended" then print("hi") myNewData = event.response -- print ("From server : "..myNewData) decodedData = (json.decode( myNewData)) SaveData() else end end end network.request( "The webserver site(JSON display only)", "GET", networkListener )