{"action":"created","issue":{"url":"https://api.github.com/repos/Lullabot/amp-library/issues/89","repository_url":"https://api.github.com/repos/Lullabot/amp-library","labels_url":"https://api.github.com/repos/Lullabot/amp-library/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/Lullabot/amp-library/issues/89/comments","events_url":"https://api.github.com/repos/Lullabot/amp-library/issues/89/events","html_url":"https://github.com/Lullabot/amp-library/issues/89","id":158901429,"number":89,"title":"Special Characters","user":{"login":"adonisfigueroa","id":3927270,"avatar_url":"https://avatars.githubusercontent.com/u/3927270?v=3","gravatar_id":"","url":"https://api.github.com/users/adonisfigueroa","html_url":"https://github.com/adonisfigueroa","followers_url":"https://api.github.com/users/adonisfigueroa/followers","following_url":"https://api.github.com/users/adonisfigueroa/following{/other_user}","gists_url":"https://api.github.com/users/adonisfigueroa/gists{/gist_id}","starred_url":"https://api.github.com/users/adonisfigueroa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adonisfigueroa/subscriptions","organizations_url":"https://api.github.com/users/adonisfigueroa/orgs","repos_url":"https://api.github.com/users/adonisfigueroa/repos","events_url":"https://api.github.com/users/adonisfigueroa/events{/privacy}","received_events_url":"https://api.github.com/users/adonisfigueroa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Lullabot/amp-library/labels/invalid","name":"invalid","color":"e6e6e6"},{"url":"https://api.github.com/repos/Lullabot/amp-library/labels/Phase%202","name":"Phase 2","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"sidkshatriya","id":638477,"avatar_url":"https://avatars.githubusercontent.com/u/638477?v=3","gravatar_id":"","url":"https://api.github.com/users/sidkshatriya","html_url":"https://github.com/sidkshatriya","followers_url":"https://api.github.com/users/sidkshatriya/followers","following_url":"https://api.github.com/users/sidkshatriya/following{/other_user}","gists_url":"https://api.github.com/users/sidkshatriya/gists{/gist_id}","starred_url":"https://api.github.com/users/sidkshatriya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidkshatriya/subscriptions","organizations_url":"https://api.github.com/users/sidkshatriya/orgs","repos_url":"https://api.github.com/users/sidkshatriya/repos","events_url":"https://api.github.com/users/sidkshatriya/events{/privacy}","received_events_url":"https://api.github.com/users/sidkshatriya/received_events","type":"User","site_admin":false},"milestone":null,"comments":22,"created_at":"2016-06-07T11:37:12Z","updated_at":"2016-06-08T17:39:59Z","closed_at":"2016-06-07T17:44:10Z","body":"Some text with special characters has a wrong parse, for example:\r\n\r\n$amp = new AMP();\r\n$amp->loadHtml(\"You’re there\");\r\necho $amp->convertToAmpHtml();\r\n\r\nOr symbols:\r\n$amp->loadHtml(\"end&#8203;\");\r\n\r\nOther examples:\r\npremière\r\nof ‘A\r\na – b\r\nGael García Bernal\r\n-“quotes”-\r\n"},"comment":{"url":"https://api.github.com/repos/Lullabot/amp-library/issues/comments/224670092","html_url":"https://github.com/Lullabot/amp-library/issues/89#issuecomment-224670092","issue_url":"https://api.github.com/repos/Lullabot/amp-library/issues/89","id":224670092,"user":{"login":"adonisfigueroa","id":3927270,"avatar_url":"https://avatars.githubusercontent.com/u/3927270?v=3","gravatar_id":"","url":"https://api.github.com/users/adonisfigueroa","html_url":"https://github.com/adonisfigueroa","followers_url":"https://api.github.com/users/adonisfigueroa/followers","following_url":"https://api.github.com/users/adonisfigueroa/following{/other_user}","gists_url":"https://api.github.com/users/adonisfigueroa/gists{/gist_id}","starred_url":"https://api.github.com/users/adonisfigueroa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adonisfigueroa/subscriptions","organizations_url":"https://api.github.com/users/adonisfigueroa/orgs","repos_url":"https://api.github.com/users/adonisfigueroa/repos","events_url":"https://api.github.com/users/adonisfigueroa/events{/privacy}","received_events_url":"https://api.github.com/users/adonisfigueroa/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T17:39:59Z","updated_at":"2016-06-08T17:39:59Z","body":"It works if the content to UTF-8 is parsed before the call loadHTML and then the results are parsing to initial encoded:\r\n\r\n$text = iconv('ISO-8859-1', 'UTF-8//TRANSLIT//IGNORE', $text);\r\n$amp = new AMP();\r\n$amp->loadHtml($text);\r\n$text_amp = $amp->convertToAmpHtml();\r\n$text_amp = iconv('UTF-8', 'ISO-8859-1//TRANSLIT//IGNORE', $text_amp);\r\n\r\nThanks again. You could mention about the encoding supported in the documentation."}}
{"actor":{"display_login":"adonisfigueroa"}}