Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Bugfix & compatibility enhancement - #3

Open
billychow wants to merge 2 commits into
bluewormlabs:masterfrom
billychow:master
Open

billychow wants to merge 2 commits into
bluewormlabs:masterfrom
billychow:master

Conversation

@billychow

Copy link
Copy Markdown
  • Fixed compatibility with PHP 5.2 which doesn't support late static binding
  • To force DOMDocument load by UTF-8 (dirty fix)
  • Remove redundant libxml error

Billy.Zhou added 2 commits February 25, 2013 17:09
@chrismcmacken

Copy link
Copy Markdown
Member

If you can resolve that one comment then I'll test this and pull it in.

@billychow

Copy link
Copy Markdown
Author

I've tried, but it's not working as we expected.
So I just google it and found a dirty fix to set encoding to utf-8 explicitly.

refer to: http://www.php.net/manual/en/domdocument.loadhtml.php

@chrismcmacken

Copy link
Copy Markdown
Member

On second thought, we can't hard code this as UTF-8. If there's another encoding in use we don't want to import it as UTF-8. We should find the encoding from the document that we're parsing, if there isn't one it should default to ISO-8859-1 as the HTTP 1.1 spec says that's what the default should be.

It looks like this is going to be a little bit bigger than the simple fix proposed above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants