On 2012-01-18, Harry Putnam <
rea...@newsguy.com> wrote:
> I'm having a little trouble googling up the details for this, possibly
> using weak search strings, or at least the wrong ones.
>
> How can I generate symbols from other languages perhaps, like the one
> you sometimes see used as a `bullet';
>
> (It appears like a small letter `o', smaller than usual and is
> raised off the baseline to midline).
>
> or a similar suitable character?
>
> Something that works in console or text mode. Or in an xterm.
You need multilingual support in your console for anything of this sort to
work. For instance, if your terminal emulator understands UTF-8 encoding,
then you can just print the UTF-8 bytes.
What is the UTF-8 sequence for the HTML character • ? We can use
my "txr" utility together with "od" to find this out, and get it in octal:
$ txr -c '@(bind x "•")
@(filter :from_html x)'
x="•"
$ txr -c '@(bind x "•")
@(filter :from_html x)' | od -to1
0000000 170 075 042 342 200 242 042 012
0000010
The quote characters are 042, so the sequence we want is 342 200 242 in
between. Now that we know the codes, we can use them:
$ printf "\342\200\242 an excellent point\n"
• an excellent point
> I seem to recall that one can manipulate a standard English keyboard
> in some way to generate various characters.
The input method for entering special characters, assuming there even is one,
is entirely system-specific. If all you want is to output the character, I
wouldn't waste my time learning how to input it.
In an UTF-8 environment like the one I'm using, if you find a character in your
browser that you wuold like to be able to use just cut it and paste it into the
terminal. E.g.
$ od -to1
[paste character here, then hit Enter and Ctrl-D]
[now take the octal codes]
For instance, let's try it with the chinese character 漢:
$ od -to1
漢 <-- I cut and pasted this from a web page, and hit Enter, Ctrl-D.
0000000 346 274 242 012 <-- now we have this output from od
0000004
012 is the linefeed, so 346 274 and 242 are the UTF-8 bytes.
Test:
$ printf "the 'kan' in 'kanji' is: \346\274\242\n"
the 'kan' in 'kanji' is: 漢
Cheers ...