Readers, How to solve this unicode input error please?> postscript("~/tmp/test.eps",width=100/25.4,height=100/25.4,horizontal=FALSE,onefile=TRUE,paper="special") > testx<-seq(1:5) > testy<-seq(1:5) > plot(testy~testx) > mtext('text (O?)\n more text',side=3,line=1)Warning messages: 1: In mtext("text (O?)\n more text", side = 3, line = 1) : conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <e2> 2: In mtext("text (O?)\n more text", side = 3, line = 1) : conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <82> 3: In mtext("text (O?)\n more text", side = 3, line = 1) : conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <82> 4: In mtext("text (O?)\n more text", side = 3, line = 1) : conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <e2> 5: In mtext("text (O?)\n more text", side = 3, line = 1) : conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <82> 6: In mtext("text (O?)\n more text", side = 3, line = 1) : conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <82> If the command to print to postscript is omitted, a graph is viewed successfully, with the title text: text(O?) more text Thanks. -- r2151
On 18/02/2013 14:15, e-letter wrote:> Readers, > > How to solve this unicode input error please?On what system, in what locale? And where is Unicode mentioned? If you intended a subscript 2, use plotmath. That is not a character in the standard Postscript fonts, nor is in the encoding you selected. We don't know what that is since it depends on your locale: see ?postscript. Or use the cairo_ps device.> >> postscript("~/tmp/test.eps",width=100/25.4,height=100/25.4,horizontal=FALSE,onefile=TRUE,paper="special") >> testx<-seq(1:5) >> testy<-seq(1:5) >> plot(testy~testx) >> mtext('text (O?)\n more text',side=3,line=1) > Warning messages: > 1: In mtext("text (O?)\n more text", side = 3, line = 1) : > conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <e2> > 2: In mtext("text (O?)\n more text", side = 3, line = 1) : > conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <82> > 3: In mtext("text (O?)\n more text", side = 3, line = 1) : > conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <82> > 4: In mtext("text (O?)\n more text", side = 3, line = 1) : > conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <e2> > 5: In mtext("text (O?)\n more text", side = 3, line = 1) : > conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <82> > 6: In mtext("text (O?)\n more text", side = 3, line = 1) : > conversion failure on 'text (O?)' in 'mbcsToSbcs': dot substituted for <82> > > If the command to print to postscript is omitted, a graph is viewed > successfully, with the title text: > > text(O?) > more text > > Thanks. > > -- > r2151 > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- 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
On 19/02/2013, r-help-request at r-project.org <r-help-request at r-project.org> wrote:> ------------------------------ > > Message: 22 > Subject: Re: [R] mtext unicode failure > > On 18/02/2013 14:15, e-letter wrote: >> Readers, >> >> How to solve this unicode input error please? > > On what system, in what locale? And where is Unicode mentioned? >GNU/Linux; obtained locale settings like so: Sys.localeconv() decimal_point thousands_sep grouping int_curr_symbol "." "" "" "GBP " currency_symbol mon_decimal_point mon_thousands_sep mon_grouping "?" "." "," "\003\003" positive_sign negative_sign int_frac_digits frac_digits "" "-" "2" "2" p_cs_precedes p_sep_by_space n_cs_precedes n_sep_by_space "1" "0" "1" "0" p_sign_posn n_sign_posn "1" "1" The unicode was in the 'mtext...' command, but it seems that the mailing list server does not accept UTF-8. Tried to set this encoding: postscript([filename],encoding='UTF-8',...) Error in postscript([filename], encoding = "UTF-8", : failed to load encoding file in postscript() In addition: Warning message: In postscript([filename], encoding = "UTF-8", : failed to load encoding file 'UTF-8'> If you intended a subscript 2, use plotmath. That is not a character in > the standard Postscript fonts, nor is in the encoding you selected. We > don't know what that is since it depends on your locale: see ?postscript. > > Or use the cairo_ps device.Thanks, the result is adequate, although the position of the subscript doesn't look pleasing personally.
Apparently Analagous Threads
- non ascill characters in plots. no alternative but plotmath?
- set different font family for strings in mtext or text?
- Printing special characters
- Unable to save a plot containing Chinese (two-byte) Characters (PR#9201)
- make check for 2.5.1 RC fails on mbcsToSbcs in graphics