R-alpha: ISO Latin1 and Readline

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Fri, 13 Jun 1997 07:03:39 +0200


>>>>> Ross Ihaka writes:

> Does anyone have experience with using the readline library in
> conjunction with ISO Latin1 characters?

> In response to a prod from Martin Maechler I am trying to convert R so
> that it will accept 8-bit characters (and render them correctly in text
> and graphics).  This appears to work when I type such lines into a file
> and source it, but readline seems to intercept any 8-bit characters
> I type interactively  and refuses to let them through to R.

> Is this cured if you have the right kind of keyboard?

Hmm.

I have e.g.

hornik@aragorn:/var/tmp/hornik$ cat =E4=F6=FC.dat=20
1 2 3
4 5 6

R> x <- read.table("/var/tmp/hornik/=E4=F6=FC.dat")
R> x
  V1 V2 V3
1  1  2  3
2  4  5  6

I think the trick is that you need to have the readline init file
(INPUTRC, typically something like /etc/inputrc) specify

     # don't strip characters to 7 bits when reading
     set input-meta on
    =20
     # allow iso-latin1 characters to be inserted rather than converted t=
o
     # prefix-meta sequences
     set convert-meta off
    =20
     # display characters with the eighth bit set directly rather than
     # as meta-prefixed characters
     set output-meta on

(comments from the readline/info sample file, the settings are what we
use here ...).

> Additional query: Should accented characters be allowed in variable
> names?

Not sure.  Maybe yes so that e.g. if I had to impress someone in
Austrian I could use "Gr=F6=DFe" as a variable name ...

-k
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-