Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper table printing broken with R 3.5 #50

Closed
beansrowning opened this issue Apr 26, 2018 · 16 comments
Closed

Proper table printing broken with R 3.5 #50

beansrowning opened this issue Apr 26, 2018 · 16 comments

Comments

@beansrowning
Copy link

beansrowning commented Apr 26, 2018

Setup:

  • R 3.5.0
  • rtichoke 0.1.2
  • Windows 10
  • ConEmu

Reproducible example:

data.frame(a = 1:2, x = c("a", "b"))
#> ☻ÿþa♥ÿþ ☻ÿþx♥ÿþ
#> ☻ÿþ1♥ÿþ ☻ÿþ1♥ÿþ ☻ÿþa♥ÿþ
#> ☻ÿþ2♥ÿþ ☻ÿþ2♥ÿþ ☻ÿþb♥ÿþ
@randy3k
Copy link
Owner

randy3k commented Apr 26, 2018

For the record, it works fine on macOS.

@beansrowning
Copy link
Author

Data.table looks to be affected too:

data.table(a = 1:2, x = c("a", "b"))
#>  ☻ÿþa♥ÿþ ☻ÿþx♥ÿþ
#>☻ÿþ1:♥ÿþ ☻ÿþ1♥ÿþ ☻ÿþa♥ÿþ
#>☻ÿþ2:♥ÿþ ☻ÿþ2♥ÿþ ☻ÿþb♥ÿþ

Not tibbles though:

tibble(a = 1:2, x = c("a", "b"))
#> # A tibble: 2 x 2
#>       a x
#>   <int> <chr>
#>  1     1 a
#>  2     2 b

@randy3k
Copy link
Owner

randy3k commented Apr 26, 2018

It works fine both on Cmder and Command Prompt.

screen shot 2018-04-26 at 5 16 27 pm

@beansrowning
Copy link
Author

It looks like your R version is 3.4.3. Here's what I'm getting with 3.5:
capture2

capture

@randy3k
Copy link
Owner

randy3k commented Apr 26, 2018

I assume that it works as expected in regular R, right?
TBH, I have no clues why it happens.

PS: I just installed Conemu, it also works as usual.

@randy3k
Copy link
Owner

randy3k commented Apr 26, 2018

Oh, yeah. I can reproduce it with R 3.5.

r$> "hello"
[1] "☻ÿþhello♥ÿþ"

@beansrowning
Copy link
Author

Yeah regular R works fine--I'm using cmder as well FWIW.

I dug around a bit in the R repo and didn't see any major changes to printing, nor was there anything in the release notes. Very odd.

@randy3k
Copy link
Owner

randy3k commented Apr 26, 2018

More odd,

r$> list(a = 1, b = 2)
$`☻ÿþa♥ÿþ`
[1] 1

$b
[1] 2

@randy3k
Copy link
Owner

randy3k commented Apr 26, 2018

for reason which i don't understand, "a" is printed as "\x02\xff\xfea\x03\xff\xfe" with the extra escaped characters.

@beansrowning
Copy link
Author

That is just odd...what has changed do you think?

@randy3k
Copy link
Owner

randy3k commented Apr 26, 2018

I notice that rstudio has code related to these escaped characters.

@beansrowning
Copy link
Author

beansrowning commented Apr 27, 2018

The relevant commit from Joe Cheng, if you didn't see that already. Looks like R output needs to be homogenized to utf-8.

Still doesn't really explain why 3.5 should be different, but there you are.

@randy3k
Copy link
Owner

randy3k commented Apr 27, 2018

4e29747 should fix it.

@hongooi73
Copy link

I don't know if this helps, but 0xFEFF is the UTF-16 encoding of the byte order mark.

@beansrowning
Copy link
Author

@randy3k Confirmed working on Command Prompt and Cmder with the most recent version. Nice work!

@randy3k
Copy link
Owner

randy3k commented Apr 27, 2018

But I still don’t understand what happens to R 3.5 is causing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants