-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultipartFormData ContentHeaderEncoding UTF-8 #3754
base: master
Are you sure you want to change the base?
MultipartFormData ContentHeaderEncoding UTF-8 #3754
Conversation
Thanks for the PR! Please follow the PR template to inform why you'd like to see this change and how applicable it is for all Alamofire users. |
Thx for the quick reply, just opened a issues #3755 to describe the problem |
I guess I don't understand the need here. UTF-8 is already used for the filename encoding we get the from the system, so why would a less capable encoding be necessary? And I'm not sure Additionally, a change like this requires both updated documentation as well as tests. I can write the documentation if you can't, but tests are required as part of this change. |
Hey @jshier thx for the feedback and sorry for the late reply. Currently it look's like we use use iso-8859-1 by default and not UTF-8 for the MultipartFormData ContentHeaderEncoding. Maybe everywhere else but not for MultipartFormData. 🤔 |
if let fileName = fileName { | ||
let encodingPrefix: String | ||
if let encoding = encoding { | ||
encodingPrefix = "*=\(encoding.rawValue)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GIST, optional encoding Info with one of:
*=UTF-8
default is without only
=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it look's like its not the client but the server, the server falls back to iso-8859-1 if there is only =
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the server uses the UTF-8 String but only with iso-8859-1 char set so there are unknown characters. With *=UTF-8 we can tell the server explicitly that we are using UTF-8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed iso-8859-1 and added some tests
the change is optional and does not change current behaviour
Try to fix #3755