Completed
Branch BUG-10381-asset-loading (2dbb93)
by
unknown
122:01 queued 110:40
created

Windows1252   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 17
rs 10
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 7 1
1
<?php
2
namespace EventEspresso\core\services\formatters;
3
4
use EventEspresso\core\exceptions\InvalidDataTypeException;
5
6
defined('EVENT_ESPRESSO_VERSION') || exit;
7
8
9
10
/**
11
 * Class Windows1252
12
 * Converts from utf8 encoding to windows 1252 (aka cp1252, aka ISO-8859-1, see https://en.wikipedia.org/wiki/Windows-1252).
13
 * This is useful if you need to send a string to a site using windows 1252 character encoding
14
15
 *
16
*@package        Event Espresso
17
 * @author         Mike Nelson
18
 * @since          4.9.31.p
19
 */
20
class Windows1252 extends FormatterBase
21
{
22
23
    /**
24
     * Converts the string to windows-1252 encoding.
25
     *
26
     * @param string|int|float $input anything easily cast into a string
27
     * @return string
28
     */
29
    public function format($input)
30
    {
31
        //in case an int or float etc was passed in
32
        $input = (string)$input;
33
        $input = iconv('utf-8','cp1252//TRANSLIT', $input);
34
        return $input;
35
    }
36
}
37
// End of file EmojiRemoval.php
38
// Location: core\services\formatters/EmojiRemoval.php