Hi, Duncan
i have forwarded this thread to Nathan, who promised to look into it.
Andrie
On 17 Jun 2017 17:26, "Duncan Murdoch" wrote:
> On 17/06/2017 9:13 AM, Ben Marwick wrote:
>
>> Hi Duncan,
>>
>> Thanks for your reply. Yes, it does seem to be specific to the CTYPE
>> setting to Chinese on Windows. If I set it to English using
>> Sys.setlocale() there is no problem, then back to Chinese and the
>> authors disappear:
>>
>> Sys.setlocale("LC_ALL","English")
>> citation("readr")
>>
>
> Thanks, that makes the problem reproducible. I'll submit it as a bug
> report. Maybe someone from Microsoft will fix it.
>
> Duncan Murdoch
>
>
>> #' To cite package ‘readr’ in publications use:
>> #'
>> #' Hadley Wickham, Jim Hester and Romain Francois (2017). readr: Read
>> #' Rectangular Text Data. R package version 1.1.1.
>> #' https://CRAN.R-project.org/package=readr
>> #'
>> #' A BibTeX entry for LaTeX users is
>> #'
>> #' @Manual{,
>> #' title = {readr: Read Rectangular Text Data},
>> #' author = {Hadley Wickham and Jim Hester and Romain Francois},
>> #' year = {2017},
>> #' note = {R package version 1.1.1},
>> #' url = {https://CRAN.R-project.org/package=readr},
>> #' }
>>
>>
>> Sys.setlocale("LC_CTYPE", "Chinese")
>> citation("readr")
>>
>> #'
>> #' To cite package ‘readr’ in publications use:
>> #'
>> #' (2017). readr: Read Rectangular Text Data. R package version 1.1.1.
>> #' https://CRAN.R-project.org/package=readr
>> #'
>> #' A BibTeX entry for LaTeX users is
>> #'
>> #' @Manual{,
>> #' title = {readr: Read Rectangular Text Data},
>> #' year = {2017},
>> #' note = {R package version 1.1.1},
>> #' url = {https://CRAN.R-project.org/package=readr},
>> #' }
>> #'
>> #' ATTENTION: This citation information has been auto-generated from the
>> #' package DESCRIPTION file and may need manual editing, see
>> #' ‘help("citation")’.
>>
>> Where do we go from here? I do want to use the Chinese locale with R on
>> Windows (and perhaps others do too), so switching the locale isn't a fix.
>>
>> Thanks,
>>
>> Ben
>>
>> On 17/06/2017 10:36 PM, Duncan Murdoch wrote:
>>
>>> On 17/06/2017 7:10 AM, Ben Marwick wrote:
>>>
Recently I was trying to cite a package where the authors have ä
and ø in their names. I found that on Windows the citation() function
did not return the authors' names at all, but on Linux there was no
problem (sessionInfos at the bottom):
On Windows, no author names are returned:
>>>
>>> I'm not seeing this. You have fairly strange localization settings; see
>>> comments below.
>>>
>>>
#---
> citation("readr")
To cite package ‘readr’ in publications use:
(2017). readr: Read Rectangular Text Data. R package version 1.1.1.
https://CRAN.R-project.org/package=readr
A BibTeX entry for LaTeX users is
@Manual{,
title = {readr: Read Rectangular Text Data},
year = {2017},
note = {R package version 1.1.1},
url = {https://CRAN.R-project.org/package=readr},
}
ATTENTION: This citation information has been auto-generated from the
package DESCRIPTION file and may need manual editing, see
‘help("citation")’.
#---
On Linux we do see the author names:
#---
> citation("readr")
To cite package ‘readr’ in publications use:
Hadley Wickham, Jim Hester and Romain Francois (2017). readr:
Read Rectangular Text Data. R package version 1.1.1.
https://CRAN.R-project.org/package=readr
A BibTeX entry for LaTeX users is
@Manual{,
title = {readr: Read Rectangular Text Data},
author = {Hadley Wickham and Jim Hester and Romain Francois},
year = {2017},
note = {R package version 1.1.1},
url = {https://CRAN.R-project.org/package=readr},
}
#---
This appears to be an OS-dependent encoding issue. The citation function
does not take an encoding argument, so it's not possible to set the
encoding at the point where that function is used. The citation function
working with the packageDescription function, which does have an
encoding argument, but the default is not useful for Windows when there
is an encoding set in the DESCRIPTION of the package (in this case
UTF-8).
We can set the encoding argument in packageDescription so it works in
Windows to give the authors as expected, but it is very inconvenient to
generate citations directly from the output of this function. So I'd
like to propose a solution this problem by changing one line in the
packageDescription function, like so, from:
#---
if (missing(encoding) && Sys.getlocale("LC_CTYPE") == "C")
#---
to:
#---
if ((missing(encoding) && Sys.getlocale("LC_CTYPE