best text editor for programming Python on a Mac

Tim Chase python.list at tim.thechases.com
Sun Jun 19 22:41:48 EDT 2016


On 2016-06-20 11:32, Steven D'Aprano wrote:
> On Mon, 20 Jun 2016 04:58 am, Michael Torrie wrote:
> 
> > When the cursor is over character, do command "ga" and it will
> > show you the hex code for that character.
> > 
> > http://vim.wikia.com/wiki/Showing_the_ASCII_value_of_the_current_character
> 
> /me cries
> 
> Every time somebody refers to "the ASCII value" of non-ASCII
> characters, God kills a puppy.

Though to be fair, vim and Unicode both have their origins around
1987, so for one to know of the other would have taken a bit of
miraculous prognostication.  Despite existing since then, I don't
recall hearing much about Unicode as a *common* standard until the
early 2000s, so that's defensibly ~13 years of (semi-)obscurity
during parallel development.

The "ga" mnemonic of "[g]a=ascii value" made much more sense in the
historical context.  Now that Vim supports Unicode, "ga" shows the
ordinal value depending on the internal encoding.  If that internal
encoding is UTF or UCS encoded Unicode (whether 8-bit, 16-bit, or
32-bit, big-or-little endian), then it shows the code-point. If it's
a one- or two-byte encoding, vim returns that index.  So the
mnemonic should become "ga=ascii value or unicode code point along
with possible combing/composing-character code-points".  Not as
helpful a mnemonic.  As an aside, Vim also provides a "g8" command to
show the decomposed hex bytes of a UTF-8 byte sequence if you want
those values instead. Both should handle combining/composing
characters as well.

-tkc

For more details within vim:

:help ga
:help g8
:help encoding-values




More information about the Python-list mailing list