Comments (19)
No solution, but returning a character string and printing with cat
works in Rgui but not the console. E.g., cat(say("asdfsf", "longcat", length = 4, type="string"))
. So clearly Rgui is doing something to unicode character strings that it does not do under message
/warning
/error
and R itself does not do at all.
from cowsay.
thanks @leeper - will keep digging
from cowsay.
@gavinsimpson any help on the encoding issue on Windows?
from cowsay.
Sorry, Scott, I don't currently have access to a windows box
from cowsay.
meh, maybe we'll just put this on CRAN and say it doesn't work on Windows, seem okay @leeper @richfitz @gavinsimpson
from cowsay.
I don't have time at the moment to try to figure it out, so that's fine.
Maybe putting it on CRAN will catch the attention of someone who can make
it work.
On Tue, Nov 4, 2014 at 5:13 AM, Scott Chamberlain [email protected]
wrote:
meh, maybe we'll just put this on CRAN and say it doesn't work on Windows,
seem okay @leeper https://github.com/leeper @richfitz
https://github.com/richfitz @gavinsimpson
https://github.com/gavinsimpson—
Reply to this email directly or view it on GitHub
#9 (comment).
from cowsay.
Poll:
doesn't work:
- windows 8.1, R 3.1.1 https://twitter.com/soodoku/status/530128301738983424
- my virtualbox windows: windows 8.?, R 3.1.1
from cowsay.
I think the pertinent information is in here: http://cran.cnr.berkeley.edu/doc/manuals/r-devel/R-ints.html#Encodings-for-CHARSXPs.
Basically it seems like, on Windows, functions which use C code like message
and warning
can't properly deal with UTF-8 strings due to the Windows C compiler. It looks like cat
and print
have some sort of escape which gets around this... which is consistent with what @leeper observed (I experienced the same behaviour).
I played around with iconv
a bit to no avail. I don't think you can catch and modify a message or warning after it's called and before it's printed?
from cowsay.
@ateucher what if you use type="string"
, then call message()
, etc. manually after it comes back? does that work okay?
from cowsay.
Nope. I think as soon as message
/warning
get hold of it, it kills it:
from cowsay.
okay, boo, well, not sure what to do then.
could just not use unicode characters and use the closest ascii characters...but you've kind of solved this another way by not using those that have unicode on windows
from cowsay.
Yeah, could do gsub
on the \u strings only if os == windows. But I wouldn't want to do it wholesale and make them look worse for everybody else. Some of those might be hard to find decent replacements for though!
from cowsay.
i think maybe we should just go with the solution you've already done - and push to CRAN!
from cowsay.
Agreed! It does function on Windows, so we should go for it.
from cowsay.
So I guess this isn't really fixed yet - the appveyor build is failing on the examples using non-ascii characters (anxiouscat
). Would you want to put those in a dontrun
section?
from cowsay.
@ateucher it seems like its an issue with the match.arg
https://ci.appveyor.com/project/sckott/cowsay/build/1.0.218#L366 or am i looking at it wrong
from cowsay.
It is, but because on Windows get_who()
removes anxiouscat etc from the vector whose names are used in match.arg
. That's why they all work on Linux/Mac, but the animals with non-ASCII throw an error on Windows.
from cowsay.
I'll just remove the examples that don't work on windows...
from cowsay.
Yeah, good idea. That's the simplest solution
from cowsay.
Related Issues (20)
- why is animals object not exported? HOT 5
- Weird RJSONIO-jsonlite error upon import HOT 4
- jsonlite to suggests
- Grammatically wrong, the Yoda example text is
- retrojunkie.com is offline HOT 1
- Distinct project name, like "Rcowsay"? HOT 1
- parrot?
- 'catfact' error HOT 3
- add worstcat
- Contributing: add guidelines for whats in/out of scope HOT 2
- No message when colors are NULL? HOT 6
- Remove speech bubble from ascii HOT 17
- Standardize the spacing above animals' speech bubbles? HOT 4
- Prints everything to stderr instead of stdout HOT 5
- vignette build warning on cran HOT 3
- [feature request] appimage HOT 6
- Fix file request from CRAN
- Simplifying color argument HOT 4
- multicolor not on cran HOT 3
- Add multicolor back if it gets back up on CRAN HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cowsay.