Insert character in programming mode gives nonsensical results
Tested with build of current master
commit, 0f213196 but the same thing happens with my installed version, which is 3.36.0.
Not sure what the status of this feature is, but if I copy the character ⊖ (Unicode codepoint U+2296 CIRCLED MINUS, I chose it at random) and then use the Insert Character Code button, it gives me −1E766A00
as the result, which besides being negative is also completely unrelated to the character itself as far as I can tell.
I assumed that this feature would do one of the following things:
- Give the Unicode codepoint/UTF-16 encoding for the character (2296 in this case)
- Give the UTF-8 encoded value for this character (0xE2 0x8A 0x96 or E28A96)
Other possibilities include
- C octal escaped UTF-8: \342\212\226
- XML decimal entity:
⊖
But none of these seem to relate in any way to the value I get from gnome-calculator. Perhaps this feature wasn't tested with Unicode characters? If I enter a relatively normal character, say capital S, I get 5300
(in hexadecimal) which, while shifted to the left by 8 bits, is the correct answer. However, that bit shifting to the left by 8 (or essentially adding the two zeroes to the end) also makes no sense. The UTF-8 encoding is 0x53, UTF-16 is 0x0053 (perhaps this is what it's displaying, but LSB first for some reason?)
Perhaps whoever implemented this feature could shed some light on the behaviour I'm seeing. I would be happy to try and fix this when I have some time this week, if we agree it's a bug and I'm not missing something.