Unescaper

Unescaper encapsulates unescaping rules for single and double-quoted YAML strings.

author

Matthew Lewinski

Methods

Unescapes a single quoted string.

unescapeSingleQuotedString(string $value) : string

Arguments

$value

string

A single quoted string.

Response

string

The unescaped string.

Unescapes a double quoted string.

unescapeDoubleQuotedString(string $value) : string

Arguments

$value

string

A double quoted string.

Response

string

The unescaped string.

Unescapes a character that was found in a double-quoted string

unescapeCharacter(string $value) : string

Arguments

$value

string

An escaped character

Response

string

The unescaped character

Convert a string from one encoding to another.

convertEncoding(string $value, string $to, string $from) : string
throws

if no suitable encoding function is found (iconv or mbstring)

Arguments

$value

string

The string to convert

$to

string

The input encoding

$from

string

The output encoding

Response

string

The string with the new encoding

Constants

ENCODING

ENCODING

REGEX_ESCAPED_CHARACTER

REGEX_ESCAPED_CHARACTER