src/I18n/Formatter.php
public function asText($value, $encoding = null)
    {
        if ($value === null) {
            return $this->nullDisplay;
        }

        return Html::encode($value, true, $encoding);
    }
public function asText($value, $encoding = null)
    {
        if ($value === null) {
            return $this->nullDisplay;
        }

        return Html::encode($value, true, $encoding);
    }
Formats the value as an HTML-encoded plain text.
@param string $value the value to be formatted.
@param string $encoding
@return string the formatted result.