Ken-JP
2009-Apr-07 05:14 UTC
[R] parse_Rd() Version 2 on Japanese Vista 32 (encoding problems)
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 -- View this message in context: http://www.nabble.com/parse_Rd%28%29-Version-2-on-Japanese-Vista-32-%28encoding-problems%29-tp22922309p22922309.html Sent from the R help mailing list archive at Nabble.com.
Duncan Murdoch
2009-Apr-07 10:35 UTC
[R] parse_Rd() Version 2 on Japanese Vista 32 (encoding problems)
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 localesDeclaring 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
Ken-JP
2009-Apr-07 10:55 UTC
[R] parse_Rd() Version 2 on Japanese Vista 32 (encoding problems)
Hi Duncan, I tried \encoding{latin1} and it gave me the same result as \encoding{UTF-8} In other words, no errors, but I plenty of warnings from Warning in grep("^[[:blank:]]*\n?$", x, perl = TRUE) : perl = TRUE is only fully implemented in UTF-8 locales ----------------------------------------------------- Thanks in advance for any updates/fixes to this problem. There are enough warnings that it obfuscates other warnings/errors, so I actually check-in to my personal SVN and then check-out to retest on 2.8.1 English or 2.9alpha English before certifying the check-in as passing R CMD Check. - Ken -- View this message in context: http://www.nabble.com/parse_Rd%28%29-Version-2-on-Japanese-Vista-32-%28encoding-problems%29-tp22922309p22926641.html Sent from the R help mailing list archive at Nabble.com.