Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.48k stars 174 forks source link

Ucs2 only supports flash and js #1423

Closed joydance closed 2 years ago

joydance commented 2 years ago

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 2 years ago

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

RobDangerous commented 2 years ago

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

joydance commented 2 years ago

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