Bug 15435 - tools::Rd2txt doesn't honour tools::Rd2txt_options()$itemBullet in utf8 locales
tools::Rd2txt doesn't honour tools::Rd2txt_options()$itemBullet in utf8 locales
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Low-level
R 3.0.1
All All
: P5 minor
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-27 13:09 UTC by diffset
Modified: 2013-08-27 16:40 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description diffset 2013-08-27 13:09:58 UTC
Although itemBullet is set to "* ", "• " is used in displaying help files in utf8 locales.

> tools::Rd2txt_options()$itemBullet
[1] "* "

But "?help" gives

...
Details:

     The following types of help are available:

        • Plain text help

        • HTML help pages...

> Sys.getlocale(category = "LC_ALL")
[1] "LC_CTYPE=de_DE.UTF-8;LC_NUMERIC=C;LC_TIME=de_DE.UTF-8;LC_COLLATE=C;LC_MONETARY=de_DE.UTF-8;LC_MESSAGES=de_DE.UTF-8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=de_DE.UTF-8;LC_IDENTIFICATION=C"

Reason in tools::Rd2txt line 17:

    if (.Platform$OS.type == "windows") {
        cp <- l10n_info()$codepage
        if (cp > 0 && (cp == 874L || (cp >= 1250L && cp <= 1258L)))
            Rd2txt_options(itemBullet = "• ")
    }
    else if (!is.na(iconv("•", "UTF-8", outputEncoding)))
        Rd2txt_options(itemBullet = "• ")


itemBullet is set to "• " regardless of its previous value.
Comment 1 Peter Dalgaard 2013-08-27 13:38:35 UTC
I see this on OSX Lion too. (But not the faulty grep thing seen on Cygwin).
Comment 2 Duncan Murdoch 2013-08-27 13:48:06 UTC
It is documented that * is replaced by a bullet.  Are you objecting to that, or to the (bug) that any other bullet is also replaced?
Comment 3 diffset 2013-08-27 13:56:58 UTC
(Mit Bezug zu comment 2)
> It is documented that * is replaced by a bullet.  Are you objecting to that, or
> to the (bug) that any other bullet is also replaced?

To both actually. Of course if I specify "➤ " I would like to see it. On the other hand it should be possible to have a simple asterisk even though being in a utf8 locale.
Comment 4 Duncan Murdoch 2013-08-27 16:40:27 UTC
Fixed in R-devel and R-patched.  The decision of whether to default to the bullet symbol now happens at load time; a user can override it.