Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtThiemann committed Dec 1, 2022
1 parent 44f524d commit 202b9c1
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,9 @@ $myInt->setValue(42);
echo $myInt->getValue(); // 42
```

On String tags, `getValue()` and `setValue()` will use the raw string data, which uses Java's modified
UTF-8 encoding. To use different encodings,
use `getDecodedValue($encoding = "UTF-8")` and `setDecodedValue($value, $encoding = "UTF-8")` instead.
A list of supported encodings is returned by the `mb_list_encodings()` function.
On String tags, `getValue()` and `setValue()` use the UTF-8 encoding and convert strings based on the selected NBT flavor
when being serialized.

```php
$myString new \Aternos\Nbt\Tag\StringTag();

$myString->setDecodedValue("Hello world!");
echo $myString->getDecodedValue(); // Hello world!
```

Compound tags, list tags, and array tags implement the `ArrayAccess`, `Countable`,
and `Iterator` interfaces and can therefore be accessed as arrays.
Expand Down

0 comments on commit 202b9c1

Please sign in to comment.