@@ -342,9 +342,10 @@ Rd2txt <-
342342 }
343343
344344 # # for efficiency
345+ li <- l10n_info()
345346 WriteLines <-
346347 if (outputEncoding == " UTF-8" ||
347- (outputEncoding == " " && l10n_info() [[" UTF-8" ]])) {
348+ (outputEncoding == " " && li [[" UTF-8" ]])) {
348349 function (x , con , outputEncoding , ... )
349350 writeLines(x , con , useBytes = TRUE , ... )
350351 } else {
@@ -459,9 +460,6 @@ Rd2txt <-
459460 linestart <<- TRUE
460461 }
461462
462- encoding <- " unknown"
463-
464- li <- l10n_info()
465463 # # See the comment in ?Rd2txt as to why we do not attempt fancy quotes
466464 # # in Windows CJK locales -- and in any case they would need more work
467465 # # This covers the common single-byte locales and Thai (874)
@@ -555,18 +553,10 @@ Rd2txt <-
555553
556554 writeQ <- function (block , tag , quote = tag )
557555 {
558- if (use_fancy_quotes ) {
559- if (quote == " \\ sQuote" ) {
560- put(LSQM ); writeContent(block , tag ); put(RSQM )
561- } else {
562- put(LDQM ); writeContent(block , tag ); put(RDQM )
563- }
556+ if (quote == " \\ sQuote" ) {
557+ put(LSQM ); writeContent(block , tag ); put(RSQM )
564558 } else {
565- if (quote == " \\ sQuote" ) {
566- put(" '" ); writeContent(block , tag ); put(" '" )
567- } else {
568- put(" \" " ); writeContent(block ,tag ); put(" \" " )
569- }
559+ put(LDQM ); writeContent(block , tag ); put(RDQM )
570560 }
571561 }
572562
@@ -1045,8 +1035,6 @@ Rd2txt <-
10451035 left <- name
10461036 mid <- if (nzchar(package )) paste0(" package:" , package ) else " "
10471037 right <- " R Documentation"
1048- if (encoding != " unknown" )
1049- right <- paste0(right , " (" , encoding , " )" )
10501038 pad <- max(HDR_WIDTH - nchar(left , " w" ) - nchar(mid , " w" ) - nchar(right , " w" ), 0 )
10511039 pad0 <- pad %/% 2L
10521040 pad1 <- strrep(" " , pad0 )
0 commit comments