Skip to content

Commit

Permalink
fix utf8 encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
hedii committed Jul 6, 2015
1 parent 08db893 commit 0420ec1
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions ColissimoApi/ColissimoApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ private function getPage($id)
private function storeTable($data)
{
$table = '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title></title></head><body><table>' . $this->get_string_between($data, '<table class="dataArray" summary="Suivi de votre colis" width="100%">', '</table>') . '</table></body></html>';
//$table = mb_convert_encoding($table, 'UTF-8', 'OLD-ENCODING');
$table = utf8_encode($table);
//var_dump($table); die;
$unique_id = uniqid();
$filePath = 'temp/' . $unique_id . '.html';
$file = file_put_contents($filePath, $table);
Expand All @@ -107,8 +105,6 @@ private function storeTable($data)
private function parse($filePath)
{
$content = file_get_contents($filePath);
//var_dump($content);
//die();
$dom = new DOMDocument();
@$html = $dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'));
$dom->preserveWhiteSpace = false;
Expand Down

0 comments on commit 0420ec1

Please sign in to comment.