Parsing/Displaying 4 digit hexadecimal Unicode chars?[solved!]

Subscribe to Parsing/Displaying 4 digit hexadecimal Unicode chars?[solved!] 5 posts

Sign in to reply


 
avatar for UnknownGuardian UnknownGuardian 6220 posts
Flag Post

I got a string that says \u0417\u0434\u043e\e043d\u0447\u0435 and such. How would I make flash able to display those characters?

 
avatar for Vexthil Vexthil 184 posts
Flag Post

Flash itself cannot I believe as they are not in the standardfont. You might be able to add those into a specialised font and maybe it will work but I have not tried it.

 
avatar for UnknownGuardian UnknownGuardian 6220 posts
Flag Post

Blarg! Life is so difficult with these characters! I will have to make a manual(magic number sort of) fix then…

 
avatar for Wordblind Wordblind 1053 posts
Flag Post

Seems to work fine for me. I think text fields default to Times New Roman, which covers most common alphabets.

tf.text = "\u0417\u0434\u043e\u043d\u0447\u0435"

or 

tf.text = "\\u0417\\u0434\\u043e\\u043d\\u0447\\u0435".replace(/\\u([0-9a-f]){4}/ig,
	function():String {
		return String.fromCharCode(Number("0x" + arguments[1]));
	}));
 
avatar for UnknownGuardian UnknownGuardian 6220 posts
Flag Post

Solved! I used a open source parser and it was able to convert them for me. Flash can now handle those characters! If you want to know the details you can wisper me.

Sign in to reply