[R-sig-Geo] RStoolbox loading, Rscript, printing and e acute (é)

Mathieu Rajerison mathieu.rajerison at gmail.com
Thu Jan 21 13:58:32 CET 2016


Hi,

This post is not spatially-oriented but deals with an excellent spatial R
package named RStoobox for remote sensing.

I have a process that prints advancement operations with cat() functions.
Some contain e acute as it is for french administrations.

I noticed I had problems with the writing of e acutes after loading
RStoolbox package. I noticed the same with igraph as well

If I write an R file with the following lines :

cat("first \U00E9")
require("RStoolbox")
cat(" second \U00E9")

It gives

first é
second Ú

If I load another package like raster, the problem doesn't appear.

To see if there was any change relative to encodings, I wrote an R file
with the following lines which gives the system encoding before and after :

cat("first \U00E9 \n")
cat("--before--\n")
cat(paste("encoding = ", getOption("encoding"), "\n"))
cat(paste("locale = ", Sys.getlocale(), "\n"))
# suppressMessages(suppressWarnings(require("RStoolbox", quietly = TRUE)))
# provoque erreurs accent e aigu
require("RStoolbox")
cat("\n")
cat("--after--\n")
cat(paste("encoding = ", getOption("encoding"),"\n"))
cat(paste("locale = ", Sys.getlocale(), "\n"))
cat(" second \U00E9")

But there isn't any change :

first é
--before--
encoding =  native.enc
locale =
 LC_COLLATE=French_France.1252;LC_CTYPE=French_France.1252;LC_MONETARY=
French_France.1252;LC_NUMERIC=C;LC_TIME=French_France.1252
Le chargement a nécessité le package : RStoolbox
Message d'avis :
le package 'RStoolbox' a ÚtÚ compilÚ avec la version R 3.1.3

--after--
encoding =  native.enc
locale =
 LC_COLLATE=French_France.1252;LC_CTYPE=French_France.1252;LC_MONETARY=
French_France.1252;LC_NUMERIC=C;LC_TIME=French_France.1252
 second Ú

So, i wonder where does this come from ? And how to deal with it

Thanks in advance for your answers,

Mathieu

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list