@dolik-rce
It almost feels like it depends on how things happen to be layed out in memory or something else undefined behaviorish.
Laid out in the file more specifically, Geany tries to be "helpful", unless the user specifies an encoding, Geany will try all the ones it knows about to see if they convert successfully. First one that works wins, so a random file could be decoded as something weird if the bytes in it just happen to be a legal combo for that encoding.
One good thing it does NOT do (AFAICT) is use locale, that could make the same file open differently between different members of this project, let alone the rest of the interwebs, yuk.
Unfortunately determining encoding is impossible, the same sequence of bytes may be interpreted as several different encodings successfully. It becomes UB when different applications try different encodings in different orders, or use different heuristics to guess the encoding.
Its all a HUUUUGE mess, @b4n @eht16 can we remove all encodings except Unicode, puhleeeeese!!!!