German umlauts in iOS missing

Hi,

I have a problem, maybe Haxe 4.0.5 related. In iOS I do not see german umlauts and the strings are cut off after a occurrence of them, whereas I see the whole loca in Browser.

The loca comes from XML.
see: https://github.com/andreasdr/xfl/blob/master/openfl/lang/Locale.hx

Does anyone has the same problems? Any ideas?

Many thanx and

Best regards
Andreas

I have the same problem, but on Android. In Flash it works fine.

I have been able to get german umlauts working by adding/changing this in 8,9,6/src/openfl/_internal/text/TextLayout.hx

                    var bd: haxe.io.BytesData = new haxe.io.BytesData();
                    for (i in 0...text.length) {
                            bd.push(text.charCodeAt(i));
                            bd.push(0);
                            bd.push(0);
                            bd.push(0);
                    }
                    var textDP: lime.utils.DataPointer = lime.utils.DataPointer.fromBytesData(bd);
                    ...
                    --__hbBuffer.addUTF8...
                   ++ __hbBuffer.addCodepoints(textDP, -1, 0, -1);

However this is only a work around working for german umlauts.

I think it’s a Haxe 4 issue, I created a similar topic here.

1 Like

Yes, on my machine Strings(with Umlauts) are stored with ASCII/Latin1 when using native targets. I tried lots of stuff to get umlauts in an UTF8 string and to render it correctly with a TextField. Seems very tricky.
And some stuff is broken like Haxe.utf8.encode, decode, also other related functions. It took me 2-3 days to find this workaround.

1 Like

It really is problematic

@andreasdr correction seems to work for all iso numbers under <256 that use only 1 byte.
But I tried to show russian characters and I was unable to.

i tried subdivising the russian bytes into characters

for example , it didn’t work
bd.push(0x04);
bd.push(0x23);
bd.push(0);
bd.push(0);

1 Like