Skip to content

Return html from node + removing forcing charset #8

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

Closed
wants to merge 2 commits into from

Conversation

radupb
Copy link

@radupb radupb commented Nov 2, 2012

Hello Fabien,

This is my first ever pull request so please excuse if I get something wrong.

Please accept these changes to the default Crawler class:

  • removed forcing the charset (looks out of place - presumed left from development)
  • added html function

Thanks for accepting my requests

... and for amazing Symfony2

@@ -94,7 +94,6 @@ public function addContent($content, $type = null)
return null;
}

$charset = 'ISO-8859-1';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done on purpose as this is the default behavior of browsers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just seems that there is no way to change $charset to UTF-8 if need be. Is there a way that I am not aware of? I am fetching some HTML from an UTF-8 page and returning a the contents of a div. Although later the default charset in the addHtmlContent function is UTF-8 it seems that it's being forced to ISO-8859-1 in the addContent function.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fabpot, do you have a reference for ISO-8859-1 still being the default in modern browsers?

I think this should at least be documented, especially as like @radupb said it's not consistent with the defaults for addHtmlContent and addXmlContent. Would you be willing to accept a PR in this direction?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julien-c Could you check the default in modern browsers? Depending on what you find, I would accept to change the default to UTF-8. And of course, adding a piece of documentation about this decision would be good too.

@fabpot
Copy link
Member

fabpot commented Apr 21, 2013

Closing in favor of symfony/symfony#7750

@fabpot fabpot closed this Apr 21, 2013
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

Successfully merging this pull request may close these issues.

3 participants