Skip to content

Commit 24a2134

Browse files
authored
Merge pull request #1 from fattomhk/upload-chinese-name
Update HttpRequest.swift
2 parents 7321632 + 02f061c commit 24a2134

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/HttpRequest.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ public class HttpRequest {
124124
}
125125

126126
private func nextMultiPartLine(_ generator: inout IndexingIterator<[UInt8]>) -> String? {
127-
var result = String()
127+
var temp = [UInt8]()
128128
while let value = generator.next() {
129129
if value > HttpRequest.CR {
130-
result.append(Character(UnicodeScalar(value)))
130+
temp.append(value)
131131
}
132132
if value == HttpRequest.NL {
133133
break
134134
}
135135
}
136-
return result
136+
return String(bytes: temp, encoding: String.Encoding.utf8)
137137
}
138138

139139
static let CR = UInt8(13)

0 commit comments

Comments
 (0)