https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L74
When appending a File object to a FormData instance, the filename parameter is set as is defined in the file name attribute, throwing an exception if it includes non-ASCII characters. According to the spec, it must be encoded as ISO-8859-1, and ideally, also have a filename* parameter with the name encoded as rfc-5987, so full Unicode characters can be used in the filename. To sanitize the filename parameter to be ISO-8859-1, maybe the windows-1252 npm module could be used...
Environment
Environment:
OS: Linux 4.13
Node: 9.5.0
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: N/A
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.2.0 => 16.2.0
react-native: ^0.54.0 => 0.54.0
Expected Behavior
FormData instance would be able to encode a File object (in fact, a React Native "blob") with non-ASCII characters on its name (more exactly, spanish tildes).
Actual Behavior

Steps to Reproduce
- create a
FormData instance
- append a File object or ReactNative "blob" with non-ASCII characters in the name
- send the
FormData using fetch()
- crash
https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L74
When appending a
Fileobject to aFormDatainstance, thefilenameparameter is set as is defined in the filenameattribute, throwing an exception if it includes non-ASCII characters. According to the spec, it must be encoded as ISO-8859-1, and ideally, also have afilename*parameter with the name encoded as rfc-5987, so full Unicode characters can be used in the filename. To sanitize thefilenameparameter to be ISO-8859-1, maybe the windows-1252 npm module could be used...Environment
Expected Behavior
FormData instance would be able to encode a
Fileobject (in fact, a React Native "blob") with non-ASCII characters on its name (more exactly, spanish tildes).Actual Behavior
Steps to Reproduce
FormDatainstanceFormDatausingfetch()