[Rd] "source" fails to handle non-ascii variable names (PR#13541)

From: <kbarton_at_zbs.bialowieza.pl>
Date: Fri, 20 Feb 2009 02:20:09 +0100 (CET)

If there is variable name in the source file which contains non-ascii cha= racters, "source" gives an=20
"unexpected $end" error after first such character (even if proper file e= ncoding is provided).
This also happens with parse, when "file" is a textConnection, but not if=  the same code is provided=20
by "text" argument.
This problem seems to occur only on Windows.


> con <- textConnection("=C4=85=C4=99=C4=87=C5=BA <- 12345")
> parse(con)

Error in parse(con) : unexpected $end at 1: =C4=85

# backtick quoted names are parsed correctly:

> con <- textConnection("`=C4=85=C4=99=C4=87=C5=BA` <- 12345")
> parse(con)

expression(=C4=85=C4=99=C4=87=C5=BA <- 12345)

# also, parsing as text works:

> con <- textConnection("=C4=85=C4=99=C4=87=C5=BA <- 12345")
> parse(text=3DreadLines(con))

expression(=C4=85=C4=99=C4=87=C5=BA <- 12345) attr(,"srcfile")

  platform =3D i386-pc-mingw32
  arch =3D i386
  os =3D mingw32
  system =3D i386, mingw32
  status =3D
  major =3D 2
  minor =3D 8.1
  year =3D 2008
  month =3D 12
  day =3D 22
  svn rev =3D 47281
  language =3D R
  version.string =3D R version 2.8.1 (2008-12-22)

Windows XP (build 2600) Service Pack 3

LC_COLLATE=3DPolish_Poland.1250;LC_CTYPE=3DPolish_Poland.1250;LC_MONETARY= =3DPolish_Poland.1250;LC_NUMERIC=3DC;LC_TIME=3DPolish_Poland.1250

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 20 Feb 2009 - 09:22:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 20 Feb 2009 - 10:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive