public function htmlEncode($flags = null, $doubleEncode = true)
    {
        if ($flags === null) $flags = ENT_QUOTES | ENT_SUBSTITUTE;

        return $this->newSelf
        (
            UTF8::htmlentities
            (
                $this->scalarString,
                $flags,
                $this->encoding,
                $doubleEncode
            )
        );
    }