Question

How to use unicode characters in haxe 3?

I tried this example:

trace("Haxe is great :)"+"\u0600");

But, it will not work, I get this error:

character 29 : Invalid escape sequence

So, how would I add unicode strings? Here is where to try it: http://try.haxe.org/#be311

Was it helpful?

Solution 2

You should be able to just use the character itself:

trace("Haxe is great :) ␆" );

But whether or not that's feasible depends on your usage.

OTHER TIPS

Why not just paste the unicode character? It seems to work for me

Look at this http://try.haxe.org/#38E77

edit: relevant code in case try.haxe stops working:

trace("Haxe is great :)"+"本");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top