• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

azjezz / psl / 22520865518

28 Feb 2026 12:36PM UTC coverage: 97.768% (+0.2%) from 97.532%
22520865518

Pull #586

github

azjezz
more tests

Signed-off-by: azjezz <azjezz@protonmail.com>
Pull Request #586: add more tests

16 of 16 new or added lines in 4 files covered. (100.0%)

20 existing lines in 13 files now uncovered.

7492 of 7663 relevant lines covered (97.77%)

43.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Psl/Str/Encoding.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Psl\Str;
6

7
use Psl\Default\DefaultInterface;
8

9
/**
10
 * Enumerates supported character encodings for string operations.
11
 *
12
 * This enum defines a comprehensive list of character encodings supported for various string manipulation
13
 * and processing tasks. It includes encodings from multiple languages and regions, ensuring wide-ranging
14
 * internationalization support across different platforms and systems.
15
 */
16
enum Encoding: string implements DefaultInterface
17
{
18
    case Base64 = 'BASE64';
19
    case Uuencode = 'UUENCODE';
20
    case HtmlEntities = 'HTML-ENTITIES';
21
    case QuotedPrintable = 'Quoted-Printable';
22
    case Ascii7bit = '7bit';
23
    case Ascii8bit = '8bit';
24
    case Ucs4 = 'UCS-4';
25
    case Ucs4be = 'UCS-4BE';
26
    case Ucs4le = 'UCS-4LE';
27
    case Ucs2 = 'UCS-2';
28
    case Ucs2be = 'UCS-2BE';
29
    case Ucs2le = 'UCS-2LE';
30
    case Utf32 = 'UTF-32';
31
    case Utf32be = 'UTF-32BE';
32
    case Utf32le = 'UTF-32LE';
33
    case Utf16 = 'UTF-16';
34
    case Utf16be = 'UTF-16BE';
35
    case Utf16le = 'UTF-16LE';
36
    case Utf8 = 'UTF-8';
37
    case Utf7 = 'UTF-7';
38
    case Utf7Imap = 'UTF7-IMAP';
39
    case Ascii = 'ASCII';
40
    case EucJp = 'EUC-JP';
41
    case Sjis = 'SJIS';
42
    case EucjpWin = 'eucJP-win';
43
    case EucJp2004 = 'EUC-JP-2004';
44
    case SjisMobileDocomo = 'SJIS-Mobile#DOCOMO';
45
    case SjisMobileKddi = 'SJIS-Mobile#KDDI';
46
    case SjisMobileSoftbank = 'SJIS-Mobile#SOFTBANK';
47
    case SjisMac = 'SJIS-mac';
48
    case Sjis2004 = 'SJIS-2004';
49
    case Utf8MobileDocomo = 'UTF-8-Mobile#DOCOMO';
50
    case Utf8MobileKddiA = 'UTF-8-Mobile#KDDI-A';
51
    case Utf8MobileKddiB = 'UTF-8-Mobile#KDDI-B';
52
    case Utf8MobileSoftbank = 'UTF-8-Mobile#SOFTBANK';
53
    case Cp932 = 'CP932';
54
    case Cp51932 = 'CP51932';
55
    case Jis = 'JIS';
56
    case Iso2022Jp = 'ISO-2022-JP';
57
    case Iso2022JpMs = 'ISO-2022-JP-MS';
58
    case Gb18030 = 'GB18030';
59
    case Windows1252 = 'Windows-1252';
60
    case Windows1254 = 'Windows-1254';
61
    case Iso88591 = 'ISO-8859-1';
62
    case Iso88592 = 'ISO-8859-2';
63
    case Iso88593 = 'ISO-8859-3';
64
    case Iso88594 = 'ISO-8859-4';
65
    case Iso88595 = 'ISO-8859-5';
66
    case Iso88596 = 'ISO-8859-6';
67
    case Iso88597 = 'ISO-8859-7';
68
    case Iso88598 = 'ISO-8859-8';
69
    case Iso88599 = 'ISO-8859-9';
70
    case Iso885910 = 'ISO-8859-10';
71
    case Iso885913 = 'ISO-8859-13';
72
    case Iso885914 = 'ISO-8859-14';
73
    case Iso885915 = 'ISO-8859-15';
74
    case Iso885916 = 'ISO-8859-16';
75
    case EucCn = 'EUC-CN';
76
    case Cp936 = 'CP936';
77
    case Hz = 'HZ';
78
    case EucTw = 'EUC-TW';
79
    case Big5 = 'BIG-5';
80
    case Cp950 = 'CP950';
81
    case EucKr = 'EUC-KR';
82
    case Uhc = 'UHC';
83
    case Iso2022Kr = 'ISO-2022-KR';
84
    case Windows1251 = 'Windows-1251';
85
    case Cp866 = 'CP866';
86
    case Koi8R = 'KOI8-R';
87
    case Koi8U = 'KOI8-U';
88
    case Armscii8 = 'ArmSCII-8';
89
    case Cp850 = 'CP850';
90
    case Iso2022Jp2004 = 'ISO-2022-JP-2004';
91
    case Iso2022JpMobileKodi = 'ISO-2022-JP-MOBILE#KDDI';
92
    case Cp50220 = 'CP50220';
93
    case Cp50221 = 'CP50221';
94
    case Cp50222 = 'CP50222';
95

96
    /**
97
     * Provides the default character encoding.
98
     *
99
     * UTF-8 is selected as the default encoding because of its ability to represent any character in the Unicode
100
     * standard and its compatibility with ASCII. It's a practical choice for web and application development,
101
     * offering flexibility for handling international text and ensuring data integrity across diverse systems.
102
     *
103
     * @return static The UTF-8 encoding instance, representing the default encoding choice for string operations.
104
     *
105
     * @pure
106
     */
107
    #[\Override]
108
    public static function default(): static
109
    {
UNCOV
110
        return self::Utf8;
×
111
    }
112
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc