Re: incorrect hex number in editor

> With the hu_HU locale (iso-8859-2) I get: 0x102, 0x17A, 0x139, 0x164.
> With en_US the hex codes displayed are: 0xC3 0xBC 0xC5 0xAB.

Okay, got it: these are the Unicode codes of the symbols that are actually
displayed. In other words: the byte over which your cursor stands is
converted from the current locale to UCS and this value is displayed.

I guess that the reason is the following: The current method could be simply
implemented with one single codebase without branches that works for all
locales. (Take the byte(s) which form the symbol you're standing over,
convert from the current locale to UCS4 and display this code).

The behaviour you'd expect would need different code for the two cases:
detect whether the locale is 8-bit or not, do the conversion if it's not,
but don't convert if it is 8-bit. It'd be tougher and less straight-forward
and less logical from a programmer's view. However, this might be the
behavior an average user prefers.

I'll take a quick look at the code to see if I can patch it.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]