-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nicolus
committed
Apr 15, 2019
1 parent
26c59f4
commit 16f9331
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace PicoFeed\Filter; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use PicoFeed\Config\Config; | ||
use PicoFeed\Parser\Rss20; | ||
|
||
class EncodingTest extends TestCase | ||
{ | ||
public function testTranslitIsoToUtf8() | ||
{ | ||
$parser = new Rss20(file_get_contents(__DIR__.'/../../tests/fixtures/rss_20_iso8859-15.xml')); | ||
$feed = $parser->execute(); | ||
|
||
$content = $feed->getItems()[0]->getContent(); | ||
|
||
$this->assertEquals($content, '<p>éàùç€@ïî</p>'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="ISO-8859-15" ?> | ||
<rss version="2.0"> | ||
|
||
<channel> | ||
<title>Test feed for encoding conversion</title> | ||
<link>https://www.google.com</link> | ||
<description>The first item contains accentuated characters</description> | ||
<item> | ||
<title>RSS Tutorial</title> | ||
<link>https://www.google.com</link> | ||
<description>éàùç¤@ïî</description> | ||
</item> | ||
</channel> | ||
</rss> |