[R] parse_Rd() Version 2 on Japanese Vista 32 (encoding problems)

Duncan Murdoch murdoch at stats.uwo.ca
Tue Apr 7 12:35:52 CEST 2009


On 07/04/2009 1:14 AM, Ken-JP wrote:
> Hi,
> 
> I need some help with 2.9.0 parse_Rd() Version 2 changes.  I read the .pdf
> file and some posts on r-help, but after playing with this for several
> hours, I can't seem to get around this UTF-8 problem.
> 
> - I'm trying to get rid of some warnings during R CMD Check for R 2.9.0Alpha
> on Japanese Vista 32
> - The same setup on a R 2.9.0Alpha English XP Pro 32 works fine without any
> modification. 
> - I just have ASCII text in my .Rd files.  I don't need/intend to put any
> CJK characters in the files.
> 
> Any ideas on how to eliminate the warnings would be greatly appreciated.
> 
> - Ken
> 
> -----------------------------------------------------------------------------------
> 
> Running R CMD Check:
> 
> * checking Rd files against version 2 parser ... WARNING
> Warning in parse_Rd("./man/myfile.Rd", encoding = "unknown") :
>   non-UTF-8 multibyte locales are not supported -- reencoding to UTF-8
> *** error on file ./man/myfile.Rd
> Error in iconv(lines, enc, encoding, sub = "byte") : 
>   invalid 'from' argument
> 
> -----------------------------------------------------------------------------------
> So I tried to "cheat" by prepending:
> 
> \encoding{UTF-8}
> 
> at the top of myfile.Rd - this almost worked.  The error went away, but now,
> I'm getting a flood of:
> 
> Warning in grep("^[[:blank:]]*\n?$", x, perl = TRUE) :
>   perl = TRUE is only fully implemented in UTF-8 locales

Declaring the encoding to be a latin1 encoding might be better, e.g.

\encoding{latin1}

but I think you will probably get the grep warnings just because of your 
locale.  perl = TRUE is faster on most systems which is why we used it, 
but we could make that choice dependent on being in a locale where it is 
known to work.  I don't know if we make use of any perl-specific 
regexps, I'll have to check.

Could you please check on explicitly setting your encoding to latin1? 
If that doesn't work I'll look into reducing the use of perl=TRUE.

Duncan Murdoch




More information about the R-help mailing list