import haxe.Json;
import haxe.ds.StringMap;
class ReproEmojiStringMap {
static function dump(label:String, s:String) {
trace(label, s, s.length, [for (i in 0...s.length) s.charCodeAt(i)]);
}
static function main() {
// Get the same string from json and a literal
var fromJson:String = cast Json.parse("\"\\ud83d\\udc4d\"");
var literal = "👍";
// confirm they are the same string
dump("fromJson", fromJson);
dump("literal", literal);
trace("equal", fromJson == literal);
// Set a StringMap key using the one from JSON
var m = new StringMap<Int>();
m.set(fromJson, 1);
// Observe that the identical string literal does not work to look up this key
trace("exists(fromJson)", m.exists(fromJson));
trace("exists(literal)", m.exists(literal));
trace("get(fromJson)", m.get(fromJson));
trace("get(literal)", m.get(literal));
}
}