     }
 }
 
-extension String {
-    func encodeHTMLEntities(quoteCharacter: HTMLQuoteCharacter = .doubleQuote) -> String? {
+public extension String {
+    public func encodeHTMLEntities(quoteCharacter: HTMLQuoteCharacter = .doubleQuote) -> String? {
         guard let utf8Data = self.data(using: .utf8) else {
             return nil
         }

import Foundation
import libxml2

enum HTMLQuoteCharacter: Character {
    case none = "\0"
    case singleQuote = "'"
    case doubleQuote = "\""

    }
}

public extension Data {
    
    public func encodeHTMLEntities(quoteCharacter: HTMLQuoteCharacter = .doubleQuote) -> Data? {
        let bufferGrowthFactor = 1.4
        let inputLength = self.count
        var outputLength = Int(Double(inputLength) * bufferGrowthFactor)
