[ESS] German umlaute in ESS, Emacs & R

Martin Maechler maechler at stat.math.ethz.ch
Fri Aug 1 15:23:48 CEST 2008


>>>>> "s" == svga  <svga at arcor.de>
>>>>>     on Fri, 1 Aug 2008 13:51:16 +0200 (CEST) writes:

    s> I agree, using non-ASCII characters in variable names is
    s> a hassle. Unfortunately, these variable names are common
    s> in my working area. I find this issue interesting,
    s> because german umlauts as a value in a variable is no
    s> problem:
    >> g <- "Säge"; plot(1:10, ylab=g) g
    s> [1] "Säge"

Yes I know, and I'd say that's  *MUCH* more important.
``everyone'' want's to be able to have strings in thei native
language, notbaly used in plots and labels (e.g. factor levels).

    s> works, but

    >> ä <- 2
    s> Error: unexpected input in "\201"

    s> Btw.: I have no problems with these under Linux.

It seems to depend on the version of Emacs too:

As Tyler has noted, the problem is no longer there in the future 
emacs 23  ;-)
i.e., I can confirm that the problem is not there for me, if I
use debian/ubuntu's "emacs-snapshot" which is a version of emacs
23 (but I won't use that on a regular basis: of course, I would
do that when I was 20, even when 30, but now, I restrict
to work with unreleased versions of R (and some of its
extensions) and ESS, but for everything else, I'd like to keep
to released SW.

Martin


    s> ----- Original Nachricht ---- Von: Martin Maechler
    s> <maechler at stat.math.ethz.ch> An: enno_sandkasten at arcor.de
    s> Datum: 31.07.2008 18:30 Betreff: Re: [ESS] German umlaute
    s> in ESS, Emacs & R

    >> >>>>> "es" == enno sandkasten <enno_sandkasten at arcor.de>
    >> >>>>> on Thu, 31 Jul 2008 11:17:38 +0200 (CEST) writes:
    >> 
    es> Hi list, I use GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600)
    es> of 2008-03-26 on
    >> Windows XP and ESS Version 5.3.7, both downloaded from
    >> http://vgoulet.act.ulaval.ca/en/ressources/emacs/, and R
    >> version 2.7.1 for Windows.
    >> 
    es> My problem is that Emacs cannot handle german umlaute as
    es> R variable
    >> names:
    >> 
    >> >> ä <- 3
    es> Error: unexpected input in "\201"
    >> 
    es> This does not occur in RGui.exe. I think this is more an
    es> emacs than
    >> ess problem, but maybe there are any suggestions.
    >> 
    >> Yes, it seems an Emacs rather than ESS problem, also
    >> visible on Linux.  I can reproduce the problem also by
    >> starting R from the *shell* (M-x shell) buffer, hence
    >> it's not related to ESS, but most probably related to how
    >> emacs uses the 'comint-*' functions to communicate with
    >> the "inferior" process.  I see the problem in all cases
    >> (within Emacs), both when then emacs-input (and -output
    >> method of the process is set to utf-8 or iso-latin-1
    >> respectively {C-x RET p ...; C-x RET C-h shows you the
    >> list} and both for my default unicode utf-8 locale and
    >> with the C locale.
    >> 
    >> OTOH, I can use 'ä' in the emacs shell more less fine: I
    >> can use it for input, but it does not correctly render
    >> for output.
    >> 
    >> $ touch ä << shows Umlaut $ ls -l ä << shows Umlaut
    >> -rw-r--r-- 1 maechler sfsstaff 0 Jul 31 18:25 ? << shows
    >> question mark "?" ( $ . /u/sfs/adm/locale-deCH-UTF8.sh $
    >> ls -l ä < -rw-r--r-- 1 maechler sfsstaff 0 Jul 31 18:25 ?
    >> $ echo BLA >> ä $ ls -l ä -rw-r--r-- 1 maechler sfsstaff
    >> 4 Jul 31 18:25 ?
    >> 
    >> 
    >> BTW: I would never use non-ASCII characters in variable
    >> names, but that's really a separate issue; and I can
    >> imagine people having "good" reasons to do so.  Note that
    >> it *can* dangerous: I see different files created by
    >> 'touch ä' depending on the locale (ISO-latin-1 vs Unicode
    >> UTF-8)
    >> 
    >> 
    >> Martin
    >>




More information about the ESS-help mailing list