Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tidy replacing   with a weird character

Tags:

php

tidy

I am using Tidy (with PHP5) with UTF8 input, output, and char encoding enabled. When I clean a string with an   in it, it is replacing it with an odd character. I've tried messing with the tidy config but nothing I try seems to work.

Before Tidy:

This is a test.  Why does this not work?

After Tidy:

This is a test. ▒Why does this not work?

I don't know what the character is, but I assume it has something to do with the encoding of the enteties in utf8. Any ideas as to how I can get tidy to just leave the   alone?

like image 741
Slickrick12 Avatar asked Jul 12 '11 17:07

Slickrick12


People also ask

What package is tidy () in R?

One of the most important packages in R is the tidyr package. The sole purpose of the tidyr package is to simplify the process of creating tidy data. Tidy data describes a standard way of storing data that is used wherever possible throughout the tidyverse.

Why is Replace_na not working?

replace_na() will not work if the variable is a factor, and the replacement is not already a level for your factor. If this is the issue, you can add another level to your factor variable for 0 before running replace_na(), or you can convert the variable to numeric or character first.

What does the Tidyr package do?

tidyr provides three main functions for tidying your messy data: gather() , separate() and spread() . Sometimes two variables are clumped together in one column. separate() allows you to tease them apart ( extract() works similarly but uses regexp groups instead of a splitting pattern or position).

Is Tidyr part of tidyverse?

Similarly to readr , dplyr and tidyr are also part of the tidyverse. These packages were loaded in R's memory when we called library(tidyverse) earlier.


1 Answers

Have you tried the preserve-entities config option?

like image 147
gere Avatar answered Oct 09 '22 10:10

gere