[Rd] (PR#9201) Unable to save a plot containing Chinese (two-byte) Characters

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Sep 4 21:16:34 CEST 2006


Please can we have a full reproducible example, including the locales 
used, and exactly how you 'saved' the plot?  (As we do ask.)

If Chinese characters are 'two-byte', then this likely will not work (but 
at least European locales on MacOS X are UTF-8, so I expected Chinese ones 
to be also).

The issues are discussed in an article in the May 2006 R-News.  You do 
need to set up a suitable family to support Chinese, and the error message 
suggests that you have failed to do so: if so this is not a bug in R.

On Mon, 4 Sep 2006, stranak at ufal.ms.mff.cuni.cz wrote:

> Full_Name: Pavel Stranak
> Version: 2.3.1
> OS: Mac OS X
> Submission from: (NULL) (195.113.20.81)
> 
> 
> Whenever I draw a plot containing Chinese character, it draws fine on screen,
> but never saves to a file.
> It does not matter, whether I first draw it on screen and than save or draw
> straight to pdf.
> It is also all the same, whether the characters are in label or in the plot
> itself (via "pch=..." or text()).
> The Error is always: "conversion failure in 'mbcsToSbcs' "
> 
> This is an example:
> 
> plot(1:20, 1:20, main="汉语 Derivational Characters' Productivity")
> # it draws well, I attempt to 'Save As...' in GUI
> 
> Error in dev.copy(device = pdf, file = "/Users/pavel/Desktop/hanyu.pdf",  : 
> 	conversion failure in 'mbcsToSbcs'
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-devel mailing list