Skip to content

Commit 0497e89

Browse files
Merge pull request #27 from TheDragonCode/1.x
UTF-8 encoding is specified by default
2 parents 5503902 + 50acd51 commit 0497e89

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ vendor/
1919

2020
composer.lock
2121
package-lock.json
22+
23+
playground.php

src/Services/ConvertToXml.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919

2020
class ConvertToXml
2121
{
22+
protected DOMDocument $document;
23+
2224
public function __construct(
2325
#[Config('feeds.pretty')]
2426
bool $pretty,
25-
protected DOMDocument $document
2627
) {
28+
$this->document = new DOMDocument('1.0', 'UTF-8');
29+
2730
$this->document->formatOutput = $pretty;
2831
$this->document->preserveWhiteSpace = ! $pretty;
2932
}

0 commit comments

Comments
 (0)