Bug 16121 - '--encoding' (unknown option) when using 'R CMD Rdconv'
Summary: '--encoding' (unknown option) when using 'R CMD Rdconv'
Alias: None
Product: R
Classification: Unclassified
Component: Documentation (show other bugs)
Version: R 3.1.2
Hardware: x86_64/x64/amd64 (64-bit) Linux-Ubuntu
: P5 enhancement
Assignee: R-core
Depends on:
Reported: 2014-12-28 05:30 UTC by Chel Hee Lee
Modified: 2014-12-28 18:44 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Chel Hee Lee 2014-12-28 05:30:23 UTC
I sincerely appreciate the amount of time and effort that R core members are spending for developing R.  I hope what I am reporting is a bug.  If not, could you kindly give me an advice? 


I tried to convert './src/library/base/man/det.Rd' to other formats such as plain text or LaTeX using 'R CMD Rdconv' (R-3.1.2) with option '--encoding=UTF-8' in terminal (Ubuntu 14.04 Trusty, 64bits).  I got the message as shown in the below:

$ ls

$ R CMD Rdconv --type=txt --output=det.txt det.Rd --encoding=UTF-8
Warning: unknown option ‘--encoding=UTF-8’

$ R CMD Rdconv --type=txt --output=det.txt det.Rd
$ ls
det.Rd  det.txt

$ file -i det.Rd
det.Rd: text/plain; charset=us-ascii

$ file -i det.txt
det.txt: text/plain; charset=utf-8


My concern centres on the message 'unknown option --encoding=UTF-8' even thought this option is noted in the argument list (as shown in the below).  Am I doing something wrong to use this option?  The message clearly says 'unknown option --encoding'.  Or, is it a case where documentation has not been updated yet?  Thank you for taking times to read my report.  

$ R CMD Rdconv --help
Usage: R CMD Rdconv [options] FILE

Convert R documentation in FILE to other formats such as plain text,
HTML or LaTeX.

  -h, --help		print short help message and exit
  -v, --version		print version info and exit
  -t, --type=TYPE	convert to format TYPE
  --encoding=enc        use 'enc' as the output encoding
  --package=pkg         use 'pkg' as the package name
  -o, --output=OUT	use 'OUT' as the output file
      --os=NAME		assume OS 'NAME' (unix or windows)
      --OS=NAME		the same as '--os'

Possible format specifications are 'txt' (plain text), 'html', 'latex',
and 'example' (extract R code in the examples).

The default is to send output to stdout, which is also given by '-o -'.
Using '-o ""' will choose an output filename by removing a '.Rd'
extension from FILE and adding a suitable extension.

Report bugs at bugs.r-project.org .


$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.1 LTS
Release:	14.04
Codename:	trusty

$ R --version
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
Comment 1 Peter Dalgaard 2014-12-28 08:44:11 UTC
In principle, if you're not sure something is a bug, ask on r-devel or r-help first.

However, this really is a bug. There's a trivial miscount in tools:::.Rdconv

        else if (substr(a, 1, 10) == "--encoding=") {
            enc <- substr(a, 11, 1000)

and of course --encoding= is 11 characters, not 10. 

I'll fix it if nobody gets there first. No time just now.
Comment 2 Chel Hee Lee 2014-12-28 09:06:12 UTC
Yes, SIR!  I will ask r-devel or r-help first if I am not sure something is a bug.  I am glad that what I reported turns out a bug, fortunately.  I appreciate your kind explanation and patience with me.  

Again, thank you so much, Prof. Peter Dalgaard. 

Chel Hee Lee
Comment 3 Peter Dalgaard 2014-12-28 18:44:02 UTC
Now fixed in R-patched and R-devel (please verify)