From simon.urbanek at r-project.org  Thu Dec 31 20:50:00 2009
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Thu, 31 Dec 2009 14:50:00 -0500
Subject: [Rd] readCitationFile encoding
In-Reply-To: <20091231150516.GA1305@trex.cs.uni-magdeburg.de>
References: <20091231063312.GA991@trex.cs.uni-magdeburg.de>
	<alpine.LFD.2.00.0912310755040.20941@gannet.stats.ox.ac.uk>
	<20091231150516.GA1305@trex.cs.uni-magdeburg.de>
Message-ID: <7C0CA516-F119-4A79-99F3-EE7CEB7E8E3F@r-project.org>


On Dec 31, 2009, at 10:05 AM, Jens Elkner wrote:

> On Thu, Dec 31, 2009 at 08:01:15AM +0000, Prof Brian Ripley wrote:
>> On Thu, 31 Dec 2009, Jens Elkner wrote:
> Hi,
> 
>>> does anybody know, how to enforce a certain encoding for
>>> readCitationFile()? Haven't found any usable documentation for this :(
>> 
>> Really?
> 
> Yes. Well, just started to dive into R and that's probably the problem
> (like in old UNIX times), the help aka man pages are very useful and
> sufficient, if you know the language/system ... ;-)
> 
>> From the help file in current versions of R (2.10.1 patched, 
>> R-devel)
>> 
>>     ?readCitationFile? make use of the ?encoding? element (if any) of
>>     ?meta? to determine the encoding of the file.
> 
> Ah - ok, haven't applied the latest release.diff. But anyway, for a
> newbie it is not easy to find out, what "meta" is expected to be.
> 
>> so
>> readCitationFile(basecit, list(encoding="latin1"))
> 
> Yepp - with a leading uppercase E it works. Thanx a lot!!! :)
> 
>> is probably what you are looking for.  And PLEASE do use the 
>> recommended portable encoding names.
> 
> OT: Wondering, what does "recommended portable encoding names" in this
> context mean (e.g. AFAIK 'latin1' is not a standardized name ...).

It is in R -- since no standard name for that encoding exists in general R maps "latin1" to whatever the OS expects this to be -- see ?Encoding.


> BTW: Just build R-2.10.1 on Solaris Nevada b129 (x86_64) using its native
> iconv facilities in libc and sunperf libs (wrt. BLAS/LAPACK) only. It
> works now and all checks are saying, everything is ok. 
> 
>>> BTW: 'make check' is a relativ long running task and if one changes
>>> a source file, all checks are ran again til it gets to the code in
>>> question (in my case tests/Examples/utils-Ex.Rout.fail). Is there
>>> a shortcut to jump immediately to the utils tests?
>> 
>> No, but many sections can be suppressed -- see check --help and the 
>> environment variables discussed in the R Internals manual.
> 
> Ahh - good hint - help("check") wasn't really fruitful. However,
> 
> elkner.idev2 build/R-2.10.1/bin > ./check --help
> Can't locate File/Copy/Recursive.pm in @INC (@INC contains: ...
> 
> So still need to do a little bit tweaking ...
> 

.. rather reading the docs ;). It's R CMD check --help (since we're on R-devel knowledge of basics is assumed).

Cheers,
Simon



[Rd] readCitationFile encoding
Simon Urbanek