Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
render special characters (è é ì ò ù...) from json/dataSaver [SOLVED] — Gideros Forum

render special characters (è é ì ò ù...) from json/dataSaver [SOLVED]

piepie Member
edited January 2015 in General questions
Hi, I am trying to understand how to render some characters (è é ì ò ù...) coming from a json file:
I just switched to nativeJson hoping it would allow me to read those, but I still have some issues: any string that contains at least one of those is ignored - not rendered on screen.

I have a preloaded TTF font in my app that contains the "guilty" characters:

if I add an hardcoded TextField to render on screen any string containing these characters, it is rendered perfectly.
if I print the string in the output window it is printed perfectly.
	local strtest = "a:à, e:è é, ì, ù" --this is my test string
	local textAr3 = TextField.new(font3, strtest ) 
	stage:addChild(textAr3)
	print(strtest)
If I read the same string from a json file something happens and:
1) the textfield goes blank
2) if I print the string in the gideros output window I can read it, but any of the accented characters has been replaced by a square �


Opening my json file with notepad states that it is ANSI encoded, but if I save it as UTF-8 or Unicode, datasaver returns an error:
dataSaver.lua:100: Expected value but found invalid token at character 1
Please, any suggestion? How do I convert/encode/prepare my json so that it becomes readable by gideros?

p.s. Every issue comes only with special characters, if I use plain ones it all seems to be perfect.

Thank you :)

Comments

Sign In or Register to comment.