From 013f8b322826bd6fdaecf42435e22a47cf4c0f34 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Wed, 31 May 2017 20:48:03 +0900 Subject: [PATCH] add workaround for Windows --- R/reprex-addin.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/reprex-addin.R b/R/reprex-addin.R index 32c6b491..9d590e81 100644 --- a/R/reprex-addin.R +++ b/R/reprex-addin.R @@ -126,7 +126,10 @@ reprex_selection <- function( show = getOption("reprex.show", TRUE) ) { context <- rstudioapi::getSourceEditorContext() - selection <- newlined(rstudioapi::primary_selection(context)[["text"]]) + text <- rstudioapi::primary_selection(context)[["text"]] + # workaround for Windows (https://github.com/tidyverse/reprex/issues/82) + Encoding(text) <- "UTF-8" + selection <- newlined(text) reprex( input = selection,