                 partMimetype = mimetype
             case let .Text(filename, text, mimetype):
                 partFilename = filename
-                if let textData = text.dataUsingEncoding(NSUTF8StringEncoding) {
+                if let textData = text.dataUsingEncoding(defaults.encoding) {
                     partContent = textData
                 }
                 partMimetype = mimetype


}

struct JustSessionConfig {
    var JSONReadingOptions: NSJSONReadingOptions? = nil
    var JSONWritingOptions: NSJSONWritingOptions? = nil
    var defaultHeaders:[String:String] = [:]
    var multipartBoundary:String
}

public enum HTTPFile {
    case URL(NSURL,String?) // URL to a file, mimetype
    case Data(String,NSData,String?) // filename, data, mimetype

    public var response:NSURLResponse?
    public var error:NSError?
    public var request:NSURLRequest?
    public var encoding = NSUTF8StringEncoding
    public var JSONReadingOptions = NSJSONReadingOptions(0)

    public override var description:String {
        if let status = statusCode,
