StringUtil
in package
Useful utilities for working with various strings.
Tags
Table of Contents
- convertToUTF8() : string
- This method tries its best to convert the input string to UTF-8.
- isUTF8() : bool
- Returns true or false depending on if a string is valid UTF-8.
Methods
convertToUTF8()
This method tries its best to convert the input string to UTF-8.
public
static convertToUTF8(string $str) : string
Currently only ISO-5991-1 input and UTF-8 input is supported, but this may be expanded upon if we receive other examples.
Parameters
- $str : string
Return values
string —isUTF8()
Returns true or false depending on if a string is valid UTF-8.
public
static isUTF8(string $str) : bool
Parameters
- $str : string