emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Babel][R] Non-ascii characters in R plots
@ 2012-08-19 14:36 Christian Moe
       [not found] ` <87vcgeigyw.fsf@gmx.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Moe @ 2012-08-19 14:36 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 847 bytes --]

Hi,

When I the following example source block in Org I get a plot in which 
the non-ascii characters are replaced by double dots (namely, the 
degree sign in `degrees C' and the `Å' in `År', Norwegian for `Year').

#+begin_src R :results graphics :file 
~/Desktop/testplot-with-Babel.png :width 480 :height 360
   temp <- c(15, 17, 16, 19, 17, 18)
   year <- c(2000:2005)
   plot(year, temp, xlab="År", ylab="°C")
#+end_src

It seems to be a Babel problem, since, R is working fine; the special 
characters are preserved when I run the same script from the R command 
line.

Compare the attached testplot-with-Babel.png and testplot.png.

I'm running up-to-date Org on GNU Emacs 24.1 compiled for Mac OS 
10.6.8. My .emacs sets current-language-environment to "UTF-8".

Is this a bug, or is there a setting I should know about?

Yours,
Christian

[-- Attachment #2: testplot.png --]
[-- Type: image/png, Size: 8538 bytes --]

[-- Attachment #3: testplot-with-Babel.png --]
[-- Type: image/png, Size: 8335 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Babel][R] Non-ascii characters in R plots
       [not found] ` <87vcgeigyw.fsf@gmx.com>
@ 2012-08-20  8:23   ` Christian Moe
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Moe @ 2012-08-20  8:23 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode

On 8/20/12 1:44 AM, Eric Schulte wrote:
>> When I the following example source block in Org I get a plot in which
>> the non-ascii characters are replaced by double dots (namely, the
>> degree sign in `degrees C' and the `Å' in `År', Norwegian for `Year').
>>
>> #+begin_src R :results graphics :file
>> ~/Desktop/testplot-with-Babel.png :width 480 :height 360
>>     temp <- c(15, 17, 16, 19, 17, 18)
>>     year <- c(2000:2005)
>>     plot(year, temp, xlab="\305r", ylab="\260C")
>> #+end_src
>>
(...)
>> Yours,
>> Christian
>>
>
> Hi Christian,
>
> Your example worked for me without problem, however I had to replace the
> characters from your original email with valid (at least on my system)
> utf8 alternatives.  See the attached org-mode file and resulting plot.
>

Hi, Eric,

Thanks for taking a look. Sorry about messing up the special 
characters in the email, I should have attached a proper text file. 
But I did use valid UTF8 in Org: the same as in your example, code 
points #xC5 and #xB0.

Evaluating your example on my Mac gives the same result as before: 
Special characters are replaced with two dots. Tangling it and running 
the tangled file works fine.

It's not really a problem, I can work around it with \u.... escapes, 
which may be the safest approach anyway. But it's curious.

Since it works for you, it probably isn't Babel's fault. Maybe 
something Mac-specific in the communication between Emacs and the 
shell. Maybe there's a setting I can change, but all the variables 
I've been able to think of already default to utf-8-unix.

Yours,
Christian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-20  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-19 14:36 [Babel][R] Non-ascii characters in R plots Christian Moe
     [not found] ` <87vcgeigyw.fsf@gmx.com>
2012-08-20  8:23   ` Christian Moe

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).