From f@ridcher @ending from gm@il@com  Tue Aug 28 07:17:16 2018
From: f@ridcher @ending from gm@il@com (Faridedin Cheraghi)
Date: Tue, 28 Aug 2018 09:47:16 +0430
Subject: [Rd] build package with unicode (farsi) strings
Message-ID: <CAJTBV4V4x=tuv72GZtnQfESG_STHufEDdJfKkvCHkb2zh9XwJQ@mail.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]]



[Rd] build package with unicode (farsi) strings
Faridedin Cheraghi