[R] R CMD BATCH Unicode
Duncan Murdoch
murdoch.duncan at gmail.com
Thu Jun 27 15:26:54 CEST 2013
On 27/06/2013 9:11 AM, Ned Harding wrote:
> The problem isn't so much getting the output to work. I can get that to work too. The problem is that R doesn't know what the encoding is, so things like graphs fail.
I think the solution is pretty clear: don't expect R CMD BATCH to
accept non-native encodings. A workaround would be to write a purely
ASCII file that you give to R CMD BATCH; it reads the real script and
executes it.
Duncan Murdoch
>
> -----Original Message-----
> From: Jeff Newmiller [mailto:jdnewmil at dcn.davis.CA.us]
> Sent: Thursday, June 27, 2013 12:45 AM
> To: Ned Harding; Prof Brian Ripley; r-help at r-project.org
> Subject: RE: [R] R CMD BATCH Unicode
>
> Well, I admit that I don't mess with this stuff much, but it worked fine for me in a simple test as long as I viewed the output with an editor or console that understood UTF-8, so I dispute your assertion that this is a problem internal to R. (I needed no special arguments to R for it to work either.)
> ---------------------------------------------------------------------------
> Jeff Newmiller The ..... ..... Go Live...
> DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
> Live: OO#.. Dead: OO#.. Playing
> Research Engineer (Solar/Batteries O.O#. #.O#. with
> /Software/Embedded Controllers) .OO#. .OO#. rocks...1k
> ---------------------------------------------------------------------------
> Sent from my phone. Please excuse my brevity.
>
> Ned Harding <ned at alteryx.com> wrote:
>
> >I have no problems with the windows command line. I don't need any
> >Unicode there. It really is an internal R question because of the way
> >R is reading and writing the input and output files.
> >
> >Ned.
> >
> >-----Original Message-----
> >From: Jeff Newmiller [mailto:jdnewmil at dcn.davis.CA.us]
> >Sent: Wednesday, June 26, 2013 11:06 AM
> >To: Ned Harding; Prof Brian Ripley; r-help at r-project.org
> >Subject: Re: [R] R CMD BATCH Unicode
> >
> >Just because the subject mentions R doesn't mean it is on topic here.
> >This is more related to Windows than R. I recommend studying windows
> >documentation for awhile. A quick search turned up a number of
> >discussions on the web, including
> >http://stackoverflow.com/questions/1035388/unicode-output-on-windows-command-line.
> >---------------------------------------------------------------------------
> >Jeff Newmiller The ..... ..... Go
> >Live...
> >DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
> >Go...
> > Live: OO#.. Dead: OO#.. Playing
> >Research Engineer (Solar/Batteries O.O#. #.O#. with
> >/Software/Embedded Controllers) .OO#. .OO#.
> >rocks...1k
> >-----------------------------------------------------------------------
> >---- Sent from my phone. Please excuse my brevity.
> >
> >Ned Harding <ned at alteryx.com> wrote:
> >
> >>So just to clarify - there is no way to use R CMD BATCH on windows
> >with
> >>Unicode? Any advice of how to use R in a batch mode with Unicode
> >>inputs and outputs?
> >>
> >>Ned.
> >>
> >>-----Original Message-----
> >>From: r-help-bounces at r-project.org
> >>[mailto:r-help-bounces at r-project.org] On Behalf Of Prof Brian Ripley
> >>Sent: Wednesday, June 26, 2013 12:45 AM
> >>To: r-help at r-project.org
> >>Subject: Re: [R] R CMD BATCH Unicode
> >>
> >>On 25/06/2013 20:35, Ned Harding wrote:
> >>> Just to clarify: The encoding didn't come through in the email.
> >>print("éíôåëëåãåâáè") is meant to be a bunch of random greek
> >>characters.
> >>
> >>In that case the message is likely correct. You failed to give us the
> >
> >>'at a minimum information' required by the posting guide, but you can
> >>only have input scripts in the locale encoding (and there are no UTF-8
> >
> >>locales on Windows). So unless you were in a Greek locale, the
> >>re-encoding should have failed.
> >>
> >>> Ned.
> >>>
> >>> -----Original Message-----
> >>> From: r-help-bounces at r-project.org
> >>> [mailto:r-help-bounces at r-project.org] On Behalf Of Ned Harding
> >>> Sent: Tuesday, June 25, 2013 11:35 AM
> >>> To: r-help at r-project.org
> >>> Subject: [R] R CMD BATCH Unicode
> >>>
> >>> Hey,
> >>>
> >>> I am looking for some help using Unicode with R CMD BATCH on
> >windows.
> >>In particular I would like my input and output files to be UTF-8
> >>encoded. My command line looks like this:
> >>>
> >>> r CMD BATCH --encoding=UTF-8 in.txt out.txt
> >>>
> >>> in.txt is utf-8 encoded and contains:
> >>>
> >>> print("éíôåëëåãåâáè")
> >>>
> >>> out.txt gets:
> >>>
> >>> + <ERROR: re-encoding failure from encoding 'UTF-8'>
> >>>
> >>> What is the proper way to specify encoding on the command line?
> >>>
> >>> Thanks in advance,
> >>>
> >>> Ned.
> >>>
> >>> [[alternative HTML version deleted]]
> >>>
> >>> ______________________________________________
> >>> R-help at r-project.org mailing list
> >>> https://stat.ethz.ch/mailman/listinfo/r-help
> >>> PLEASE do read the posting guide
> >>> http://www.R-project.org/posting-guide.html
> >>> and provide commented, minimal, self-contained, reproducible code.
> >>
> >>Please do, and note what it says about HTML mail, too.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list