1

My ggVis outputs have garbled characters.
I imagine there is a mismatch between the encoding settings of my system (Windows 7 -windows ISO8859-1 (I live in Western Europe) and the encoding of GVIS page (utf-8, Firefox or Chrome).

I tried to change the language preferences of R -Studio (system -> utf8) but without success. Does anyone have any idea?

R version 3.2.2 (2015-08-14)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

 locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252       

enter image description here

lmo
  • 37,904
  • 9
  • 56
  • 69
Wilcar
  • 2,349
  • 2
  • 21
  • 48

1 Answers1

0

You need to setup system locale. For Windows this needs to be done like this:

Sys.setlocale("LC_CTYPE","en_GB.UTF-8")
Denis Rasulev
  • 3,744
  • 4
  • 33
  • 47
  • I have this warning : In Sys.setlocale("LC_CTYPE", "en_EN.UTF-8") : OS reports request to set locale to "en_EN.UTF-8" cannot be honored and there is no change... – Wilcar Jan 06 '16 at 14:46
  • Oh, my apologies! Misprinted... It's either en_US.UTF-8 or en_GB.UTF-8. – Denis Rasulev Jan 06 '16 at 14:48
  • Sorry but not working...Warning message: In Sys.setlocale("LC_CTYPE", "en_GB.UTF-8") : OS reports request to set locale to "en_GB.UTF-8" cannot be honored – Wilcar Jan 06 '16 at 14:51
  • Same happened here: https://stackoverflow.com/questions/34271457/ggvis-plots-with-iso-iec-8859-1. Do you have 32-bit version of Windows? – Denis Rasulev Jan 06 '16 at 14:58
  • 64 bits - my local settings are (french) ISO8859-1 – Wilcar Jan 06 '16 at 15:00
  • I completed my question with `sessionInfo()` – Wilcar Jan 06 '16 at 15:14
  • Try to update R to 3.2.3 (released on 2015-12-10). Also you've mentioned Chrome - do you have View -> Encoding -> Auto Detect checked up in Chrome? Just in case :) And then your info says that you are running 64-bit version of Windows on 32-bit platform. I am not sure that these are related, but in the link above same problem was reproduced on 32-bit old machine. – Denis Rasulev Jan 06 '16 at 15:20
  • It is a new pc with i5-4300U cpu! – Wilcar Jan 06 '16 at 15:24
  • Didn't mean to offense in any way, friend :) Did you try to make same plot using base system, for instance? Will it show normal words, without questions? – Denis Rasulev Jan 06 '16 at 15:26
  • Then it looks like the problem is with ggVis implementation. If I'll have any fresh ideas on how to help, I'll come back. – Denis Rasulev Jan 06 '16 at 15:39
  • in Chrome works fine with Occident 8859-1 encoding settings! (not automatic detection...) – Wilcar Jan 06 '16 at 15:39