richfitz / remoji

Emoji for R :joy_cat:
Other
42 stars 4 forks source link

Windows support #3

Open richfitz opened 8 years ago

richfitz commented 8 years ago

I'm getting test failures on windows 7; emoji conversion is not working there. screenshot_2015-10-29_16-33-52

Happens in both Rstudio and Rgui (under VMware as I don't have a native machine). Similar failure happened on winbuilder.

gaborcsardi commented 8 years ago

I'll help testing next week, I have windows at work. It might just not work on windows, especially not in the cmd terminal.

yixuan commented 8 years ago

It seems to be related to the Unicode support on Windows. Actually remoji generated the correct byte sequence \xf0\x9f\x91\8d, but the console cannot recognize it.

gaborcsardi commented 8 years ago

It seems that windows is a mess and mostly unsupported, and we would need a workaround.

E.g. using the emoji name between colons, or an empty string, when an emoji is outputted. Or we can just use ASCII replacements for some emojis at least. E.g. smileys, and the rest can be empty string.

richfitz commented 8 years ago

Yeah, sounds good. I'll have another look at windows this week and sort things out a little better. After a couple of weeks dealing with more serious packages I could probably afford to do this package a bit in my train work.

richfitz commented 8 years ago

I'll see if this update helps at all.

gaborcsardi commented 8 years ago

Hmm, interesting. If this fixes the fonts, can we detect whether it is installed?

I am afraid that the encoding conversion code in R will still fail, at least for most emojis. Anyway, we'll see.... On 24 Jan 2016 21:26, "Rich FitzJohn" notifications@github.com wrote:

I'll see if this update https://support.microsoft.com/en-gb/kb/2729094 helps at all.

— Reply to this email directly or view it on GitHub https://github.com/richfitz/remoji/issues/3#issuecomment-174343100.

richfitz commented 8 years ago

No effect here; still just a mess. I wonder if @kevinushey knows if it's possible at all? Or are we at the mercy of what Windows is willing to render here?

kevinushey commented 8 years ago

Unfortunately I don't know a great solution here, UTF-8 on Windows (and in R + RStudio) is kind of a mess. :/

Surprisingly, R complains if you try to actually construct a string literal using that representation:

> "\xf0\u009f\u0091\u008d"
Error: mixing Unicode and octal/hex escapes in a string is not allowed

Just in case that's relevant...