Kode/Kha

Ucs2 only supports flash and js

joydance opened this issue · 3 comments

Describe the bug
Ucs2 is supported only in flash or js.

Ucs2 is support all platform in haxe, but kha will throw an error in all platforms except flash or js:

abstract Ucs2(String) {
	extern public var length(get, never):Int;

	extern inline function new(str:String):Void {
		// this implementation only allows platforms which have native UCS2 String.
		// other platforms should create a shadow class in their _std directory
		#if !(flash || js)
		throw "Ucs2 String not supported on this platform";
		#end
		this = str;
	}

	extern inline function get_length() {
		return this.length;
	}

        ......
}

Expected behavior
Ucs2 support all flatform like haxe api says.

RblSb commented

I think you should report this to haxe instead:
https://github.com/HaxeFoundation/haxe/issues

Do you have test-code that does not work in Kha but works with regular Haxe for that? I didn't touch that Ucs2-abstract, https://github.com/HaxeFoundation/haxe/blob/development/std/haxe/Ucs2.hx still looks the same and I don't see a Ucs2-thing in https://github.com/HaxeFoundation/haxe/tree/development/std/cpp/_std/haxe

Oh my mistake, didn't recoginize it's from haxe std. :) I'll report this issue to haxe, thanks.