miniflux-legacy/vendor/fguillot/picofeed/lib/PicoFeed/Encoding/Encoding.php

22 lines
388 B
PHP
Raw Normal View History

2013-06-01 20:57:17 +02:00
<?php
namespace PicoFeed\Encoding;
2013-06-01 20:57:17 +02:00
2015-03-01 19:56:11 +01:00
/**
* Encoding class
*
* @package Encoding
*/
2014-05-20 20:20:27 +02:00
class Encoding
{
2014-05-25 14:47:03 +02:00
public static function convert($input, $encoding)
{
if ($encoding === 'utf-8' || $encoding === '') {
return $input;
2014-05-25 14:47:03 +02:00
}
// convert input to utf-8; ignore malformed characters
return iconv($encoding, 'UTF-8//IGNORE', $input);
2014-05-25 14:47:03 +02:00
}
2013-06-01 20:57:17 +02:00
}