From c@@rd|@g@bor @end|ng |rom gm@||@com  Mon Feb 18 17:26:39 2019
From: c@@rd|@g@bor @end|ng |rom gm@||@com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Mon, 18 Feb 2019 16:26:39 +0000
Subject: [Rd] Encoding issues
In-Reply-To: <CALEXWq344mKov29L4VrNvGrOWg-uOxiXXwjNajpmwkLv+ZvPYg@mail.gmail.com>
References: <CALEXWq344mKov29L4VrNvGrOWg-uOxiXXwjNajpmwkLv+ZvPYg@mail.gmail.com>
Message-ID: <CABtg=K=dS=1geaahi=s7R2hd1ad=h-ez-CafFj5NV_O+kiDL3A@mail.gmail.com>

>From "Writing R Extensions":

"Only ASCII characters (and the control characters tab, formfeed, LF
and CR) should be used in code files."

So I am afraid you cannot use ?m.

Gabor

On Mon, Feb 18, 2019 at 3:36 PM I?aki Ucar <iucar at fedoraproject.org> wrote:
>
> Hi,
>
> We found a (to our eyes) strange behaviour that might be a bug. First
> a little bit of context. The 'units' package allows us to set the unit
> using both SE or NSE. E.g., these both work in the same way:
>
> units::set_units(1:10, "?m")
> #> Units: [?m]
> #> [1]  1  2  3  4  5  6  7  8  9 10
>
> units::set_units(1:10, ?m)
> #> Units: [?m]
> #> [1]  1  2  3  4  5  6  7  8  9 10
>
> That's micrometers, and works fine if the session charset is UTF-8.
> Now the funny part comes with Windows. The first version, with quotes,
> works fine, but the second one fails. This is easy to demonstrate from
> Linux:
>
> LC_CTYPE=en_US.iso88591 Rscript -e 'units::set_units(1:10, "?m")'
> #> Units: [?m]
> #> [1]  1  2  3  4  5  6  7  8  9 10
>
> LC_CTYPE=en_US.iso88591 Rscript -e 'units::set_units(1:10, ?m)'
> #> Error: unexpected input in "units::set_units(1:10, ?"
> #> Execution halted
>
> However, if you use the first version, with quotes, in an example, and
> the package is checked on Windows, it fails too (see
> https://ci.appveyor.com/project/edzer/units/builds/22440023#L747). The
> package declares UTF-8 encoding, so none of these errors should, in
> principle, happen. Am I wrong?
>
> Thanks in advance, regards,
> I?aki
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Encoding issues
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=