Re: [R-pkg-devel] Conversion failure in 'mbcsToSbcs'

2024-02-21 Thread Package Maintainer
Dear Ivan and all:

Thank you for this helpful advice. I have received confirmation that
the package is now on its way to CRAN.

Many thanks again.

LAR

On Wed, Feb 21, 2024 at 12:45 PM Ivan Krylov  wrote:
>
> В Wed, 21 Feb 2024 12:29:02 +0000
> Package Maintainer  пишет:
>
> > Error: processing vignette 'ggenealogy.Rnw' failed with diagnostics:
> >  chunk 58 (label = plotCBText)
>
> In order to use the non-standard graphics device, the chunk must
> set the option fig=TRUE. Otherwise, when something calls
> graphics::strwidth('Lubomír Kubáček', "inches"), R notices that no
> graphics device is active and creates a default one, which happens to
> be pdf() and has all these problems. With fig=TRUE, Sweave will
> initialise the cairo_pdf() device first, and then graphics::strwidth()
> will use the existing device, avoiding the error.
>
> --
> Best regards,
> Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Conversion failure in 'mbcsToSbcs'

2024-02-21 Thread Package Maintainer
Hello:

Thank you again for your help.

I resubmitted the package (after it passed R CMD check) and it seems
there is still an ERROR on the windows builder as shown here:
https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240221_121754/Debian/00check.log

Error: processing vignette 'ggenealogy.Rnw' failed with diagnostics:
 chunk 58 (label = plotCBText)
Error in graphics::strwidth(pMPDF$label, "inches") :
  conversion failure on 'Lubomír  Kubáček' in 'mbcsToSbcs': for č (U+010D)

My latest vignette file can be found on the package github:

https://github.com/lindsayrutter/ggenealogy/blob/master/vignettes/ggenealogy.Rnw

The recommended cairo_pdf() syntax was used on lines 47-54:

<>=
my.Swd <- function(name, width, height, ...)
 grDevices::cairo_pdf(
  filename = paste(name, "pdf", sep = "."),
  width = width, height = height
 )
@
\SweaveOpts{grdevice=my.Swd,pdf=FALSE}

I am a bit unsure how to remove this persisting ERROR; is there
anything else you might recommend I look into?

Thank you again.

LAR

On Mon, Feb 19, 2024 at 5:48 PM Package Maintainer
 wrote:
>
> Dear Duncan:
>
> Thank you for the feedback about that. I have removed the unrecognized
> file and resubmitted the package. Thanks again.
>
> Kind regards,
> LAR
>
>
> On Mon, Feb 19, 2024 at 2:20 PM Duncan Murdoch  
> wrote:
> >
> > Removing (or moving to inst) the unrecognized file should be sufficient.
> >
> > Duncan Murdoch
> >
> > On 19/02/2024 7:27 a.m., Package Maintainer wrote:
> > > Hello all:
> > >
> > > Thank you both for your advice.
> > >
> > > I attempted to upload the latest version to CRAN, and again received
> > > the notification that the package did not pass.
> > >
> > > It seems there are no warnings or errors (only 2 notes) on windows
> > > (https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240219_122904/Windows/00check.log)
> > > and debian 
> > > (https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240219_122904/Debian/00check.log).
> > >
> > > One of the notes is simply stating that the package has been archived
> > > (which occurred even when I contacted folks before the deadline). The
> > > other note I can fix easily (an unrecognized file type in the main
> > > directory).
> > >
> > > The only error delineated to me appears to be from a submission back
> > > in November 2023
> > > (https://cran-archive.r-project.org/web/checks/2023/2023-11-14_check_results_ggenealogy.html).
> > >
> > > Is there anything particular I should do? >
> > > Thank you.
> > >
> > > Kind regards,
> > > LAR
> > >
> > > On Sat, Feb 17, 2024 at 1:18 PM Duncan Murdoch  
> > > wrote:
> > >>
> > >> At line 66 of your document, you have this chunk:
> > >>
> > >> <>=
> > >> rm(list=ls())
> > >> @
> > >>
> > >> That removed the device.  You need to put its definition after that.
> > >> (It might also need to come earlier if you're doing plotting before
> > >> this, and again even later if you remove it again.)
> > >>
> > >> By the way, I'd recommend using knitr for Rnw documents instead of
> > >> Sweave.  It will require a few changes, but in general it's more
> > >> flexible and works a bit better.
> > >>
> > >> Duncan Murdoch
> > >>
> > >>
> > >>
> > >> On 17/02/2024 7:51 a.m., Package Maintainer wrote:
> > >>> Dear Ivan:
> > >>>
> > >>> Thank you for your help again.
> > >>>
> > >>> Thanks for your suggestion to use cairo_pdf() instead of pdf() to
> > >>> allow for the multi-lingual plots.
> > >>>
> > >>> I incorporated your advice and added the the code you suggested:
> > >>>
> > >>> <>=
> > >>> my.Swd <- function(name, width, height, ...)
> > >>>grDevices::cairo_pdf(
> > >>> filename = paste(name, "pdf", sep = "."),
> > >>> width = width, height = height
> > >>>)
> > >>> @
> > >>> \SweaveOpts{grdevice=my.Swd,pdf=FALSE}
> > >>>
> > >>> as shown in lines 49-56 in my new vignette file here
> > >>> (https://github.com/lindsayrutter/ggenealogy/blob/master/vignettes/ggenealogy.Rnw).
> > >>>
> > >>> Upon attempting to bui

Re: [R-pkg-devel] Conversion failure in 'mbcsToSbcs'

2024-02-19 Thread Package Maintainer
Dear Duncan:

Thank you for the feedback about that. I have removed the unrecognized
file and resubmitted the package. Thanks again.

Kind regards,
LAR


On Mon, Feb 19, 2024 at 2:20 PM Duncan Murdoch  wrote:
>
> Removing (or moving to inst) the unrecognized file should be sufficient.
>
> Duncan Murdoch
>
> On 19/02/2024 7:27 a.m., Package Maintainer wrote:
> > Hello all:
> >
> > Thank you both for your advice.
> >
> > I attempted to upload the latest version to CRAN, and again received
> > the notification that the package did not pass.
> >
> > It seems there are no warnings or errors (only 2 notes) on windows
> > (https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240219_122904/Windows/00check.log)
> > and debian 
> > (https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240219_122904/Debian/00check.log).
> >
> > One of the notes is simply stating that the package has been archived
> > (which occurred even when I contacted folks before the deadline). The
> > other note I can fix easily (an unrecognized file type in the main
> > directory).
> >
> > The only error delineated to me appears to be from a submission back
> > in November 2023
> > (https://cran-archive.r-project.org/web/checks/2023/2023-11-14_check_results_ggenealogy.html).
> >
> > Is there anything particular I should do? >
> > Thank you.
> >
> > Kind regards,
> > LAR
> >
> > On Sat, Feb 17, 2024 at 1:18 PM Duncan Murdoch  
> > wrote:
> >>
> >> At line 66 of your document, you have this chunk:
> >>
> >> <>=
> >> rm(list=ls())
> >> @
> >>
> >> That removed the device.  You need to put its definition after that.
> >> (It might also need to come earlier if you're doing plotting before
> >> this, and again even later if you remove it again.)
> >>
> >> By the way, I'd recommend using knitr for Rnw documents instead of
> >> Sweave.  It will require a few changes, but in general it's more
> >> flexible and works a bit better.
> >>
> >> Duncan Murdoch
> >>
> >>
> >>
> >> On 17/02/2024 7:51 a.m., Package Maintainer wrote:
> >>> Dear Ivan:
> >>>
> >>> Thank you for your help again.
> >>>
> >>> Thanks for your suggestion to use cairo_pdf() instead of pdf() to
> >>> allow for the multi-lingual plots.
> >>>
> >>> I incorporated your advice and added the the code you suggested:
> >>>
> >>> <>=
> >>> my.Swd <- function(name, width, height, ...)
> >>>grDevices::cairo_pdf(
> >>> filename = paste(name, "pdf", sep = "."),
> >>> width = width, height = height
> >>>)
> >>> @
> >>> \SweaveOpts{grdevice=my.Swd,pdf=FALSE}
> >>>
> >>> as shown in lines 49-56 in my new vignette file here
> >>> (https://github.com/lindsayrutter/ggenealogy/blob/master/vignettes/ggenealogy.Rnw).
> >>>
> >>> Upon attempting to build (R CMD build ggenealogy), I received the ERROR:
> >>>
> >>> Error: processing vignette 'ggenealogy.Rnw' failed with diagnostics:
> >>> object 'my.Swd' not found
> >>> --- failed re-building ‘ggenealogy.Rnw’
> >>>
> >>> I tried replacing the code you suggested to various locations and
> >>> separating the \SweaveOpts line to be located at separate locations.
> >>> However, I received the same ERROR each time.
> >>>
> >>> Do you have any suggestions or ideas on how to resolve this error?
> >>>
> >>> I again thank you for your help with this issue.
> >>>
> >>> Kind regards,
> >>> LAR
> >>>
> >>>
> >>> On Thu, Feb 15, 2024 at 3:17 PM Ivan Krylov  wrote:
> >>>>
> >>>> В Mon, 12 Feb 2024 16:01:27 +
> >>>> Package Maintainer  пишет:
> >>>>
> >>>>> Unfortunately, I received a reply from the CRAN submission team
> >>>>> stating that my vignette file is still obtaining the "mbcsToSbcs"
> >>>>> ERROR as is shown here
> >>>>> (https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240212_152455/Debian/00check.log).
> >>>>
> >>>> I am sorry for leading you down the wrong way with my advice. It turns
> >>>> out that no 8-bit Type-1 encoding kn

Re: [R-pkg-devel] Conversion failure in 'mbcsToSbcs'

2024-02-19 Thread Package Maintainer
Hello all:

Thank you both for your advice.

I attempted to upload the latest version to CRAN, and again received
the notification that the package did not pass.

It seems there are no warnings or errors (only 2 notes) on windows
(https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240219_122904/Windows/00check.log)
and debian 
(https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240219_122904/Debian/00check.log).

One of the notes is simply stating that the package has been archived
(which occurred even when I contacted folks before the deadline). The
other note I can fix easily (an unrecognized file type in the main
directory).

The only error delineated to me appears to be from a submission back
in November 2023
(https://cran-archive.r-project.org/web/checks/2023/2023-11-14_check_results_ggenealogy.html).

Is there anything particular I should do?

Thank you.

Kind regards,
LAR

On Sat, Feb 17, 2024 at 1:18 PM Duncan Murdoch  wrote:
>
> At line 66 of your document, you have this chunk:
>
> <>=
> rm(list=ls())
> @
>
> That removed the device.  You need to put its definition after that.
> (It might also need to come earlier if you're doing plotting before
> this, and again even later if you remove it again.)
>
> By the way, I'd recommend using knitr for Rnw documents instead of
> Sweave.  It will require a few changes, but in general it's more
> flexible and works a bit better.
>
> Duncan Murdoch
>
>
>
> On 17/02/2024 7:51 a.m., Package Maintainer wrote:
> > Dear Ivan:
> >
> > Thank you for your help again.
> >
> > Thanks for your suggestion to use cairo_pdf() instead of pdf() to
> > allow for the multi-lingual plots.
> >
> > I incorporated your advice and added the the code you suggested:
> >
> > <>=
> > my.Swd <- function(name, width, height, ...)
> >   grDevices::cairo_pdf(
> >filename = paste(name, "pdf", sep = "."),
> >width = width, height = height
> >   )
> > @
> > \SweaveOpts{grdevice=my.Swd,pdf=FALSE}
> >
> > as shown in lines 49-56 in my new vignette file here
> > (https://github.com/lindsayrutter/ggenealogy/blob/master/vignettes/ggenealogy.Rnw).
> >
> > Upon attempting to build (R CMD build ggenealogy), I received the ERROR:
> >
> > Error: processing vignette 'ggenealogy.Rnw' failed with diagnostics:
> > object 'my.Swd' not found
> > --- failed re-building ‘ggenealogy.Rnw’
> >
> > I tried replacing the code you suggested to various locations and
> > separating the \SweaveOpts line to be located at separate locations.
> > However, I received the same ERROR each time.
> >
> > Do you have any suggestions or ideas on how to resolve this error?
> >
> > I again thank you for your help with this issue.
> >
> > Kind regards,
> > LAR
> >
> >
> > On Thu, Feb 15, 2024 at 3:17 PM Ivan Krylov  wrote:
> >>
> >> В Mon, 12 Feb 2024 16:01:27 +
> >> Package Maintainer  пишет:
> >>
> >>> Unfortunately, I received a reply from the CRAN submission team
> >>> stating that my vignette file is still obtaining the "mbcsToSbcs"
> >>> ERROR as is shown here
> >>> (https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240212_152455/Debian/00check.log).
> >>
> >> I am sorry for leading you down the wrong way with my advice. It turns
> >> out that no 8-bit Type-1 encoding known to pdf() can represent both
> >> 'Lubomír Kubáček' and 'Anders Ågren':
> >>
> >> lapply(
> >>   setNames(nm = c(
> >>'latin1', 'cp1252', 'latin2', 'latin7',
> >>'latin-9', 'CP1250', 'CP1257'
> >>   )), function(enc)
> >>iconv(enc2utf8(c(
> >> 'Lubomír Kubáček', 'Anders Ågren'
> >>)), 'UTF-8', enc, toRaw = TRUE)
> >> ) |> sapply(lengths)
> >> # one of the two strings cannot be represented, returning a NULL:
> >> #  latin1 cp1252 latin2 latin7 latin-9 CP1250 CP1257
> >> # [1,]  0  0 15  0   0 15  0
> >> # [2,] 12 12  0 12  12  0 12
> >>
> >> While it may still be possible to give extra parameters to pdf() to use
> >> a font encoding that covers all the relevant characters, it seems
> >> easier to switch to cairo_pdf() for your multi-lingual plots. Place the
> >> following somewhere in the beginning of the vignette:
> >>
> >> <>=
> >> my.Swd <- function(name, width, height, ...)
> >>   grDevic

Re: [R-pkg-devel] Conversion failure in 'mbcsToSbcs'

2024-02-17 Thread Package Maintainer
Dear Ivan:

Thank you for your help again.

Thanks for your suggestion to use cairo_pdf() instead of pdf() to
allow for the multi-lingual plots.

I incorporated your advice and added the the code you suggested:

<>=
my.Swd <- function(name, width, height, ...)
 grDevices::cairo_pdf(
  filename = paste(name, "pdf", sep = "."),
  width = width, height = height
 )
@
\SweaveOpts{grdevice=my.Swd,pdf=FALSE}

as shown in lines 49-56 in my new vignette file here
(https://github.com/lindsayrutter/ggenealogy/blob/master/vignettes/ggenealogy.Rnw).

Upon attempting to build (R CMD build ggenealogy), I received the ERROR:

Error: processing vignette 'ggenealogy.Rnw' failed with diagnostics:
object 'my.Swd' not found
--- failed re-building ‘ggenealogy.Rnw’

I tried replacing the code you suggested to various locations and
separating the \SweaveOpts line to be located at separate locations.
However, I received the same ERROR each time.

Do you have any suggestions or ideas on how to resolve this error?

I again thank you for your help with this issue.

Kind regards,
LAR


On Thu, Feb 15, 2024 at 3:17 PM Ivan Krylov  wrote:
>
> В Mon, 12 Feb 2024 16:01:27 +
> Package Maintainer  пишет:
>
> > Unfortunately, I received a reply from the CRAN submission team
> > stating that my vignette file is still obtaining the "mbcsToSbcs"
> > ERROR as is shown here
> > (https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240212_152455/Debian/00check.log).
>
> I am sorry for leading you down the wrong way with my advice. It turns
> out that no 8-bit Type-1 encoding known to pdf() can represent both
> 'Lubomír Kubáček' and 'Anders Ågren':
>
> lapply(
>  setNames(nm = c(
>   'latin1', 'cp1252', 'latin2', 'latin7',
>   'latin-9', 'CP1250', 'CP1257'
>  )), function(enc)
>   iconv(enc2utf8(c(
>'Lubomír Kubáček', 'Anders Ågren'
>   )), 'UTF-8', enc, toRaw = TRUE)
> ) |> sapply(lengths)
> # one of the two strings cannot be represented, returning a NULL:
> #  latin1 cp1252 latin2 latin7 latin-9 CP1250 CP1257
> # [1,]  0  0 15  0   0 15  0
> # [2,] 12 12  0 12  12  0 12
>
> While it may still be possible to give extra parameters to pdf() to use
> a font encoding that covers all the relevant characters, it seems
> easier to switch to cairo_pdf() for your multi-lingual plots. Place the
> following somewhere in the beginning of the vignette:
>
> <>=
> my.Swd <- function(name, width, height, ...)
>  grDevices::cairo_pdf(
>   filename = paste(name, "pdf", sep = "."),
>   width = width, height = height
>  )
> @
> \SweaveOpts{grdevice=my.Swd,pdf=FALSE}
>
> This should define a new plot device function for Sweave, one that
> handles more Unicode characters correctly.
>
> > PS: Thanks for the advice about plain text mode. Hopefully, I have
> > correctly abide by that advice in this current email.
>
> This e-mail arrived in plain text, thank you!
>
> --
> Best regards,
> Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Conversion failure in 'mbcsToSbcs'

2024-02-12 Thread Package Maintainer
Dear Ivan:

Thank you again for all your support.

I recently incorporated your suggestion to add the line:

\SweaveOpts{pdf.encoding = ISOLatin2.enc}

to line 32 of my vignette file, the latest copy of which is located
here 
(https://github.com/lindsayrutter/ggenealogy/blob/master/vignettes/ggenealogy.Rnw).

I don't *believe* I changed or created a plot device either, which you
advised not to do.

I then ran:

1) R CMD build
2) debian-gcc-devel
(https://builder.r-hub.io/status/ggenealogy_1.0.3.tar.gz-fc9f3ff459314bc2bcfd2df00b5c38f3)
3) debian-clang-devel
(https://builder.r-hub.io/status/ggenealogy_1.0.3.tar.gz-fa86bcdc246042e194a7558c018ed19b)

And my .tar file passed all three. So, I then uploaded my .tar file to
the CRAN submission page.

Unfortunately, I received a reply from the CRAN submission team
stating that my vignette file is still obtaining the "mbcsToSbcs"
ERROR as is shown here
(https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20240212_152455/Debian/00check.log).

The latest version of my package and its vignette code is on my
GitHub: 
https://github.com/lindsayrutter/ggenealogy/blob/master/vignettes/ggenealogy.Rnw

I'm still a bit at a loss on how to resolve this issue. I would be all
ears if you (and/or others) might have any further advice.

Thank you again for your patience and support.

Kind regards,
LAR

PS: Thanks for the advice about plain text mode. Hopefully, I have
correctly abide by that advice in this current email.


On Sun, Nov 19, 2023 at 3:25 PM Ivan Krylov  wrote:
>
> On Sun, 19 Nov 2023 13:53:52 +
> Package Maintainer  wrote:
>
> > I added the code you suggested to the package vignette:
>
> It won't work without setting my.Swd as the new plot device instead of
> pdf():
>
> \SweaveOpts{grdevice=my.Swd,pdf=FALSE}
>
> You have this directive commented out a few lines later, inside a code
> block. It should instead be present outside the code block, without a %
> before it.
>
> (It's best to link to a copy of the code available for viewing
> somewhere. While I was able to fish out a copy of your package from the
> CRAN FTP server this time, it is not always possible to do so.)
>
> A less intrusive way to avoid the error is using the following Sweave
> directive:
>
> \SweaveOpts{pdf.encoding = ISOLatin2.enc}
>
> (Without changing the plot device or creating a new plot device in a
> hidden code block.)
>
> > In both those cases, I didn't see the ERROR of "Conversion failure in
> > 'mbcsToSbcs'".
>
> In order to replicate the problem, you need (1) a fairly recent R-devel
> (a pre-release version, e.g. [*]) and (2) the environment variable
> _R_CHECK_MBCS_CONVERSION_FAILURE_ set. R-hub runs recent R-devel but
> doesn't set the environment variable. I don't know for sure, but I
> think that you are running a released version of R. I hope that R-core
> will make this test part of R CMD check --as-cran, making it possible
> to reproduce such failures with just a copy of R-devel, without extra
> environment variables.
>
> --
> Best regards,
> Ivan
>
> [*] https://cran.r-project.org/bin/windows/base/rdevel.html
>
> P.S. Could you please switch your mailer to plain text instead of HTML
> when sending messages to the list? When you compose your e-mail in
> HTML, your mailer automatically prepares a plain text equivalent where
> the code block is seriously mangled. This plain text equivalent is what
> the list subscribers see:
> https://stat.ethz.ch/pipermail/r-package-devel/2023q4/010102.html

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Conversion failure in 'mbcsToSbcs'

2023-11-19 Thread Package Maintainer
Hello Ivan:

Thank you for your helpful response here.

I added the code you suggested to the package vignette:







*<>=my.Swd <- function(name, width, height,
...) grDevices::cairo_pdf(  filename = paste(name, "pdf", sep = "."),
width = width, height = height )@*

This particular code did not seem to negatively affect the vignette
production. R CMD check seemed to pass on my local machine. And running the
vignette line-by-line on my local machine (even after setting:
*Sys.setenv('_R_CHECK_MBCS_CONVERSION_FAILURE_'
= 'TRUE')*) did not cause any errors and successfully produced plots.

R CMD check also seems to pass with only one NOTE when I ran it on the
"Debian Linux, R-devel, GCC" (by using the rhub::check("ggenealogy",
platform = "debian-gcc-devel") in my local RStudio) (
https://builder.r-hub.io/status/original/ggenealogy_1.0.3.tar.gz-9ffea1329d0b485eb9019dbf035a69f5)
and when I ran it on "Debian Linux, R-devel, clang, ISO-8859-15 locale" (by
using the rhub::check("ggenealogy", platform = "debian-clang-devel") in my
local RStudio) (
https://builder.r-hub.io/status/original/ggenealogy_1.0.3.tar.gz-58e271ac7d2144aaab035cf7c5d9f879
).

In both those cases, I didn't see the ERROR of "Conversion failure in
'mbcsToSbcs'".

So, I created a new .tar file and uploaded it to the CRAN submission site.
However, I received another response that my package had errors (
https://win-builder.r-project.org/incoming_pretest/ggenealogy_1.0.3_20231118_121231/Debian/00check.log),
which does show the "conversion failure on 'Lubomír Kubáček' in
'mbcsToSbcs': for č (U+010D)" ERROR.

I'm a bit unsure why this ERROR is still persisting, and how to
troubleshoot it. I am unable to replicate it on my local machine. Do you
have any suggestions how I can resolve this issue based on this latest
update?

Thank you again for your advice and patience.

Kind regards,
LAR

On Fri, Nov 17, 2023 at 3:56 PM Ivan Krylov  wrote:

> Hello!
>
> В Fri, 17 Nov 2023 14:16:27 +
> Package Maintainer  пишет:
>
> > 2) set_null_device("cairo") to the vignettes/ggenealogy.Rnw file (this
> > gives me a "could not find function "set_null_device"" ERROR)
>
> I don't think this function from the cowplot package would have helped.
> You are compiling a LaTeX vignette, so you need to produce a PDF plot
> to include in the rendered PDF vignette.
>
> > 1) pdf.options(encoding='ISOLatin2.enc') to the
> > vignettes/ggenealogy.Rnw file
>
> Something like this should help. Here's how I can reproduce the problem
> on latest R-devel:
>
> Sys.setenv('_R_CHECK_MBCS_CONVERSION_FAILURE_' = 'TRUE')
> pdf()
> graphics::strwidth('Lubomír Kubáček', "inches")
> # Error in graphics::strwidth("Lubomír Kubáček", "inches") :
> #   conversion failure on 'Lubomír Kubáček' in 'mbcsToSbcs': for í
> #   (U+00ED)
>
> Notably, the error is absent if I either call
> pdf.options(encoding='ISOLatin2.enc') before pdf() or replace pdf()
> with the better-Unicode-equipped cairo_pdf().
>
> As a workaround, you could use the latter device in your vignette by
> following section "Custom Graphics Devices" of help(RweaveLatex) (or
> section 4.1.5 "Graphics devices" of the Sweave vignette):
>
> <>=
> my.Swd <- function(name, width, height, ...)
>  grDevices::cairo_pdf(
>   filename = paste(name, "pdf", sep = "."),
>   width = width, height = height
>  )
> @
> \SweaveOpts{grdevice=my.Swd,pdf=FALSE}
>
> With this in the document, the following chunk doesn't crash
> _R_CHECK_MBCS_CONVERSION_FAILURE_=TRUE R-devel CMD Sweave:
>
> <>=
> # NB: fig=TRUE must be set, otherwise R calls pdf() with default options
> graphics::strwidth('Lubomír Kubáček', "inches")
> @
>
> So why doesn't it help to call pdf.options() in a Sweave chunk? My
> guess is that's too late for Sweave to pick it up by the time it's
> weaving a vignette, but RweaveLatex presents an alternative way of
> setting the option:
>
> \SweaveOpts{pdf.encoding = ISOLatin2.enc}
>
> With this in the vignette, my previous example also avoids the crash.
>
> Good luck!
>
> --
> Best regards,
> Ivan
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Conversion failure in 'mbcsToSbcs'

2023-11-17 Thread Package Maintainer
Hello:

About three weeks ago, I received a message that a CRAN package I maintain
(ggenealogy) had issues with "Unicode chars not available to pdf()".

As shown here
,
it seems ERRORs occur when building the vignette, such as:

1) conversion failure on 'Lubomír Kubáček' in 'mbcsToSbcs': for č (U+010D)
2) conversion failure on 'Anders Ågren' in 'mbcsToSbcs': for Å (U+00C5)

I have attempted to add lines such as:

1) pdf.options(encoding='ISOLatin2.enc') to the vignettes/ggenealogy.Rnw
file
2) set_null_device("cairo") to the vignettes/ggenealogy.Rnw file (this
gives me a "could not find function "set_null_device"" ERROR)

I have been a bit stuck on how to resolve these new issues. A few days ago,
I noticed my package was removed from CRAN before the stated deadline AoE
(Anywhere on Earth), and so I decided to upload all changes I had made up
until that point into a new ggenealogy_1.0.2.tar.gz file to the CRAN
submission website. However, it seems the problem remain, and so I'm now
reaching out to the list-serve to see if this may help me resolve the
issues in a timely manner.

Thank you for your patience and guidance.

Kind regards,
LAR

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel