commit fe3af96391a94053867f89f5a1e015f1ccb62e24
parent 0710d7441e8d84c905f7a5d5b438cd2f456821c5
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Sat, 18 May 2024 11:09:57 +0200
ensure that output HTML is UTF-8 encoded
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/yt.R b/yt.R
@@ -154,7 +154,8 @@ top_mainfeed <- paste0("<details>\n<summary class=\"button\">Channel List</summa
bottom <- paste0("</main>\n</body>\n</html>")
# print files -------------------------------------------------------------------
-sink("index.html")
+html_output <- file("index.html", open = "wt", encoding = "UTF-8")
+sink(html_output, split = TRUE)
cat(
template, "\n",
top, "\n",
@@ -163,9 +164,13 @@ cat(
bottom, "\n"
)
sink()
+close(html_output)
for (i in 1:length(entry_pc)) {
- sink(paste0("videos_", i, ".html"))
+ html_output <- file(
+ paste0("videos_", i, ".html"), open = "wt", encoding = "UTF-8"
+ )
+ sink(html_output)
cat(
template, "\n",
top, "\n",
@@ -174,6 +179,7 @@ for (i in 1:length(entry_pc)) {
bottom, "\n"
)
sink()
+ close(html_output)
}
# EOF yt.R