external encoder
haxe3 support
minor fix for haxe3