entering unicode (was Python usage numbers)

rusi rustompmody at gmail.com
Sun Feb 12 22:09:32 EST 2012


On Feb 12, 10:36 pm, Nick Dokos <nicholas.do... at hp.com> wrote:
> rusi <rustompm... at gmail.com> wrote:
> > On Feb 12, 10:51 am, Steven D'Aprano <steve
> > +comp.lang.pyt... at pearwood.info> wrote:
> > > On Sun, 12 Feb 2012 15:38:37 +1100, Chris Angelico wrote:
> > > > Everything that displays text to a human needs to translate bytes into
> > > > glyphs, and the usual way to do this conceptually is to go via
> > > > characters. Pretending that it's all the same thing really means
> > > > pretending that one byte represents one character and that each
> > > > character is depicted by one glyph. And that's doomed to failure, unless
> > > > everyone speaks English with no foreign symbols - so, no mathematical
> > > > notations.
>
> > > Pardon me, but you can't even write *English* in ASCII.
>
> > > You can't say that it cost you £10 to courier your résumé to the head
> > > office of Encyclopædia Britanica to apply for the position of Staff
> > > Coördinator. (Admittedly, the umlaut on the second "o" looks a bit stuffy
> > > and old-fashioned, but it is traditional English.)
>
> > > Hell, you can't even write in *American*: you can't say that the recipe
> > > for the 20¢ WobblyBurger™ is © 2012 WobblyBurgerWorld Inc.
>
> > [Quite OT but...] How do you type all this?
> > [Note: I grew up on APL so unlike Rick I am genuinely asking :-) ]
>
> [Emacs speficic]
>
> Many different ways of course, but in emacs, you can select e.g. the TeX input method
> with C-x RET C-\ TeX RET.
> which does all of the above symbols with the exception of the cent
> symbol (or maybe I missed it) - you type the thing in the first column and you
> get the thing in the second column
>
> \pounds £
> \'e     é
> \ae     æ
> \"o     ö
> ^{TM}   ™
> \copyright ©
>
> I gave up on the cent symbol and used ucs-insert (C-x 8 RET) which allows you to type
> a name, in this case CENT SIGN to get ¢.
>
> Nick

[OT warning]
I asked this on the emacs list:

No response there and the responses here are more helpful so asking
here.
My question there was emacs-specific. If there is some other app,
thats fine.

I have some bunch of sanskrit (devanagari) to type.  It would be
easiest for me if I could have the English (roman) as well as the
sanskrit (devanagari).

For example using the devanagari-itrans input method I can write the
gayatri mantra using

OM bhUrbhuvaH suvaH
tatsaviturvarenyam
bhargo devasya dhImahi
dhiyo yonaH prachodayAt

and emacs produces *on the fly* (ie I cant see/edit the above)

ॐ भूर्भुवः सुवः
तत्सवितुर्वरेण्यम्
भर्गो देवस्य धीमहि
धियो योनः प्रचोदयात्

Can I do it in batch mode? ie write the first in a file and run some
command on it to produce the second?



More information about the Python-list mailing list