Invalid multibyte string error in distill blog post.

Hi, I'm new to distill. Using distill version 1.2.
I tried to make a new distill blog and tried to render it with a Japanese title, as follows.

---
title: "日本語"
description: |
  A short description of the post.
author:
  - name: Nora Jones
    url: https://example.com/norajones
date: 01-26-2021
output:
  distill::distill_article:
    self_contained: false
---


```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)

Distill is a publication format for scientific and technical writing, native to the web.

Learn more about using Distill at https://rstudio.github.io/distill.


but, when I tried to render this blog post, I get error as follow:



nchar(x) でエラー: invalid multibyte string, element 1
呼び出し: ... update_collection_listing -> strip_trailing_newline -> substring
実行が停止されました

 
When I change YAML from title:"日本語" to title: "English", this post works fine.

Is there any workaround for this problem?

Try saving with UTF-8 encoding. This works

---
title: "日本語"
output: html_document
---

"中文", "עברית", "english"

1 Like

Thank you for the post.

Here, the problem is that I cannot render the post with the RStudio project initiated with distill blog.

I can render the usual rmarkdown file with the default project, including Japanese characters in YAML, but as I explained in the question when I tried from the project initiated with distill blog, I get an error.

My bad. This works too in UTF-8


title: "日本語"
description: |
A new article created using the Distill format.
author:


"中文", "עברית", "english"

Thanks, technocrat!

I still can't resolve the situation. In my environment,

The following error occurs when I use Japanese in the title YAML.

nchar(x) でエラー: invalid multibyte string, element 1
 呼び出し:  <Anonymous> ... update_collection_listing -> strip_trailing_newline -> substring
 実行が停止されました 

Anyway, thanks for letting me know that distill allows Japanese in the title YAML. I gonna tweak some settings in my environment and see if distill in my environment allows me to render the post.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.