Closed ManuelHentschel closed 1 year ago
Thanks for the report, the detailed investigation, and examples. This was a long standing problem on Windows which should have disappeared with R >= 4.2-0. Could you try installing a more recent version of R (currently v4.2-2) and try with that?
Please let me know if you succeed. If you can supply a link to your bib file, I could investiggate myself, as well.
It is a long story and Tomas Kalibera from R-core has a number of posts and blogs about that but basically Windows was converting UTF-8 to the locale (code page) and then back. In the process, character that are not available in that locale were replaced by 'approximations' causing havoc for characters not in that locale. Windows now has proper UTF-8 locale and R-4.2 and later use that. As a consequence,
\enc2native
helps in some cases but is not a universal solution and causes its own problems since its success depends on the local encoding and on the particular characters involved.
Thanks for the quick response!
Upgrading to 4.2.0 solved the problem, both in the example above and the original project.
First off, thanks for this very useful package!
As stated in the title, I'm having a problem with the encoding of special characters on windows. I read the corresponding part of the readme, but did not manage to solve this issue without modifying the Rdpack package itself (or maybe by switching everything to native encoding, but I'd like to avoid that).
My setup is
If I try to cite bibliography entries containing special characters (German umlauts most of the time), they do not show up correctly in the output. A minimal example producing this issue for me would be for example:
Below is a more detailed example .Rd illustrating this behavior, and the corresponding HTML produced when installing the package. It seems to me that the output of
\Sexpr
is always expected to have native encoding (i.e.latin1
on my machine) and e.g.\InsertRef
produces strings that are UTF-8 encoded. Wrapping the corresponding R functions inenc2native
seems to fix the issue.Content of an .Rd file:
Screenshot of the rendered help page:
HTML generated by
R CMD INSTALL --html .