Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upnon-ASCII characters #27
Comments
|
See #17 |
|
There are pedagogical reasons why we would want to have non-ASCII characters. Any idea why this is now a requirement for CRAN? |
|
I have no idea. Cultural imperialism? Somehow we fixed this before, but I'm running the same code now and it doesn't seem to be working.
Ugh, I am at a loss here. Any help would be appreciated! |
|
How about:
iconv(x, "latin1", "ASCII", "")
On Dec 15, 2017, at 10:30 AM, Ben Baumer ***@***.***> wrote:
I have no idea. Cultural imperialism?
Somehow we fixed this before, but I'm running the same code now and it doesn't seem to be working.
> showNonASCII(WorldCities$name)
511: Xank<c2><82><c2><9d>ndi
518: L<c2><82><c2><9d>nk<c2><82><c2><9d>ran
523: Beyl<c2><83><c2><aa>qan
> x <- WorldCities$name
> Encoding(x) <- "UTF-8"
> y <- iconv(x, from = "UTF-8", to = "latin1", sub = "")
> showNonASCII(y)
511: Xank<82><9d>ndi
518: L<82><9d>nk<82><9d>ran
523: Beyl<83><aa>qan
> z <- stringi::stri_trans_general(WorldCities$name, "latin-ascii")
> showNonASCII(z)
511: Xank<c2><82><c2><9d>ndi
518: L<c2><82><c2><9d>nk<c2><82><c2><9d>ran
523: Beyl<c2><83><c2><aa>qan
Ugh, I am at a loss here. Any help would be appreciated!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
Nicholas Horton
Professor of Statistics
Department of Mathematics and Statistics, Amherst College
PO Box 5000, AC #2239
Amherst, MA 01002-5000
|
|
OK, that seems to have worked. Thanks @nicholasjhorton ! |
Ugh.