 
 // MARK: -
 
+/// Error
+private enum HTMLSpecialCharactersError: Error {
+    case invalidHexSquence
+    case invalidDecimalSquence
+    case invalidEscapeSquence
+    case invalidBufferSequence
+    case notErrorMatchedUnicode(code: unichar)
+}
+
 /**
  Comparator for HtmlEscapeMap structure.
  */

}

/**
 Decode, convert unicode scalar value to UTF16 code.
 - parameter unicode: 
 - returns:
 */
private func decodeUnicodeScalar(unicode: UInt) -> [unichar] {
    // This convert algorithm is based on https://en.wikipedia.org/wiki/UTF-16
    let w: UInt  = (unicode & 0b00000000000111110000000000000000) >> 16 - 1
    let x1: UInt = (unicode & 0b00000000000000001111110000000000) >> 10
    let x2: UInt = (unicode & 0b00000000000000000000001111111111) >> 0
    let u1: UInt16 = UInt16((0b11011000 << 8) + (w << 6) + x1)
    let u2: UInt16 = UInt16(UInt(0b11011100 << 8) + x2)
    return [u1, u2]


/**
 Encode, convert UTF16 code to unicode scalar value.
 - parameter first: First one of a surrogate pair.
 - parameter second: Second one of a surrogate pair.
 - returns: Unicode scalar value.
 */
private func convertToUnicodeScalar(firstOfSurrogatePair u1: unichar, second u2: unichar) -> UInt? {
    // This convert algorithm is based on https://en.wikipedia.org/wiki/UTF-16
    guard u1 > (0b11011000 << 8) else { return nil }
    guard u1 < (0b11011100 << 8) else { return nil }
