Re: [Rd] iconv to UTF-16 encoding produces error due to embedded nulls (write.table with fileEncoding param)

2016-02-22 Thread nos...@altfeld-im.de
Dear R developers

I think I have found a bug that can be reproduced with two lines of code
and I am very thankful to get your first assessment or feed-back on my
report.

If this is the wrong mailing list or I did something wrong
(e. g. semi "anonymous" email address to protect my privacy and defend
unwanted spam) please let me know since I am new here.

Thank you very much :-)

J. Altfeld

On Tue, 2016-02-16 at 18:25 +0100, nos...@altfeld-im.de wrote:
> 
> 
> If I execute the code from the "?write.table" examples section
> 
>   x <- data.frame(a = I("a \" quote"), b = pi)
>   # (ommited code)
>   write.csv(x, file = "foo.csv", fileEncoding = "UTF-16LE")
> 
> the resulting CSV file has a size of 6 bytes which is too short
> (truncated):
> 
>   """,3
> 
> The problem seems to be the iconv function:
> 
>   iconv("foo", to="UTF-16")
> 
> produces
> 
>   Error in iconv("foo", to = "UTF-16"):
>   embedded nul in string: '\xff\xfef\0o\0o\0'
> 
> In 2010 a (partial) patch for this problem was submitted:
> 
> http://tolstoy.newcastle.edu.au/R/e10/devel/10/06/0648.html
> 
> Are there chances to fix this problem since it prevents writing Windows
> UTF-16LE text files?
> 
> 
> 
> PS: This problem can be reproduced on Windows and Linux.
> 
> ---
> 
> > sessionInfo()
> R version 3.2.3 (2015-12-10)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 14.04.3 LTS
> 
> locale:
>  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
> LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
> LC_PAPER=en_US.UTF-8   LC_NAME=C 
>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
> LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C   
> 
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods
> base 
> 
> loaded via a namespace (and not attached):
> [1] tools_3.2.3
> >
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Avoid texinfo 6.1

2016-02-22 Thread Dirk Eddelbuettel

On 22 February 2016 at 09:57, Prof Brian Ripley wrote:
| There are problems with the texi2dvi in the recently released texinfo 
| 6.1.  (The bug has been reported.)  Avoid 6.1 if you can, but if not 
| setting the environment variable
| 
| R_TEXI2DVICMD=emulation
| 
| will enable R to build, including NEWS.pdf and all the vignettes.
| 
| We are working on a more complete workaround for R-devel and 3.2.4.

Confirming that there are issues.  I had to rebuild 3.2.3 for Debian (as
the default JDK switched from OpenJDK 7 to 8) and had it just fail on
NEWS.pdf for no clear reason. I was a bit short on time last week because of
travel; I should have reported back here.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Avoid texinfo 6.1

2016-02-22 Thread Prof Brian Ripley
There are problems with the texi2dvi in the recently released texinfo 
6.1.  (The bug has been reported.)  Avoid 6.1 if you can, but if not 
setting the environment variable


R_TEXI2DVICMD=emulation

will enable R to build, including NEWS.pdf and all the vignettes.

We are working on a more complete workaround for R-devel and 3.2.4.

--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel