3 ms·
Qt (C++ framework) is also UTF-16, so maybe if you're lucky you could pass strings between Java and Qt without transcoding?
by ReactiveJelly 4y ago
Qt (C++ framework) is also UTF-16, so maybe if you're lucky you could pass strings between Java and Qt without transcoding?
- lelanthran 4y ago> Qt (C++ framework) is also UTF-16, so maybe if you're lucky you could pass strings between Java and Qt without transcoding? Probably not; the other fields in the string will be different (the length field might be unsigned in Qt while it's almost certainly signed in Java. Java strings may have other fields that are not present in the Qt string (and vice versa).
- xigoi 4y agoWhy would signedness be a problem? If you reinterpret a non-negative two's complement integer as unsigned, you get the same value.
- lelanthran 4y ago> Why would signedness be a problem? If you reinterpret a non-negative two's complement integer as unsigned, you get the same value. It won't be a problem if the string being passed from Java to C is const. It will be if the C code increases the size of the string enough to set the highest bit. Then Java will be looking at negative length strings.