         case EqualsSecondDigit(firstDigit: UInt8)
     }
     
-    private class func parseText(c: UInt8) -> (c: UnicodeScalar?, state: QuotedPrintableState) {
+    private class func parseText(_ c: UInt8) -> (c: UnicodeScalar?, state: QuotedPrintableState) {
         switch c {
         case 61:
             return (c: nil, state: .Equals)

        var charCount = 0
        
        var result = ""
        result.reserveCapacity(string.characters.count)
        
        while let c = gen.next() {
            switch c {
            case 32...60, 62...126:
                charCount += 1
                result.append(UnicodeScalar(c))
            case 13:
                continue
            case 10:
                if result.characters.last == " " || result.characters.last == "\t" {
                    result.append("=\r\n")
                    charCount = 0
                } else {

                    result.append("=\r\n")
                    charCount = 0
                }
                //result.append(UnicodeScalar(61).escaped(asASCII: false))
                result.append("=" + c.hexString().uppercased())
                charCount+=3
            }
            
