From i@t@z@hn @ending from gm@il@com  Thu Aug 30 17:25:59 2018
From: i@t@z@hn @ending from gm@il@com (Ista Zahn)
Date: Thu, 30 Aug 2018 11:25:59 -0400
Subject: [Rd] build package with unicode (farsi) strings
In-Reply-To: <CAJuCY5zsiVvu_+4hq=6OmWdprNTC1Cu07Vq=zRZdzqfcGMObwg@mail.gmail.com>
References: <CAJTBV4V4x=tuv72GZtnQfESG_STHufEDdJfKkvCHkb2zh9XwJQ@mail.gmail.com>
 <CAJuCY5zsiVvu_+4hq=6OmWdprNTC1Cu07Vq=zRZdzqfcGMObwg@mail.gmail.com>
Message-ID: <CA+vqiLHqopUra-uOn3qt-zxFOUT0bscJpnhUYBit1sFwkT+xKw@mail.gmail.com>

On Thu, Aug 30, 2018 at 3:11 AM Thierry Onkelinx
<thierry.onkelinx at inbo.be> wrote:
>
> Dear Farid,
>
> Try using the ASCII notation. letters_fa <- c("\u0627", "\u0641").

... as recommend in the manual:
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Encoding-issues

Best,
Ista

The full
> code table is available at https://www.utf8-chartable.de
>
> Best regards,
>
>
>
> ir. Thierry Onkelinx
> Statisticus / Statistician
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
> FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> thierry.onkelinx at inbo.be
> Havenlaan 88 bus 73, 1000 Brussel
> www.inbo.be
>
> ///////////////////////////////////////////////////////////////////////////////////////////
> To call in the statistician after the experiment is done may be no more
> than asking him to perform a post-mortem examination: he may be able to say
> what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
> ///////////////////////////////////////////////////////////////////////////////////////////
>
> <https://www.inbo.be>
>
> 2018-08-28 7:17 GMT+02:00 Faridedin Cheraghi <faridcher at gmail.com>:
>
> > Hi,
> >
> > I have a R script file with Persian letters in it defined as a variable:
> >
> > #' @export
> > letters_fa <- c('???','?','?','?','?','?','?','?','?','?','?','?')
> >
> > I have specified the encoding field in my DESCRIPTION file of my package.
> >
> > ...
> > Encoding: UTF-8
> > ...
> >
> > I also included Sys.setlocale(locale="Persian") in my .RProfile, so it is
> > executed when RCMD is called. However, after a BUILD and INSTALL, when I
> > access the variable from the package, the characters are not printed
> > correctly:
> > > futils::letters_fa
> >  [1] "<d8><a7><d9><84><d9><81>" "<d8><a8>"                 "<d9><be>"
> >            "<d8><aa>"                 "<d8><ab>"
> >  [6] "<d8><ac>"                 "<da><86>"                 "<d8><ad>"
> >            "<d8><ae>"                 "<d8><b1>"
> > [11] "<d8><b2>"                 "<d8><af>"
> >
> >
> > thanks
> > Farid
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] build package with unicode (farsi) strings
Ista Zahn