Github user daserge commented on the pull request:

    
https://github.com/apache/cordova-plugin-file-transfer/pull/71#issuecomment-150277783
  
    The endpoint for this test on the file-transfer server can be the following 
(requires [`node-iconv`](https://github.com/bnoordhuis/node-iconv) dependency):
    ```javascript
    if (req.url == '/upload_non_utf' && req.method.toLowerCase() == 'post') {
            var form = new formidable.IncomingForm();
            form.parse(req, function(err, fields, files) {
                res.writeHead(200, {'content-type': 'text/plain'});
                console.log(stringify({fields: fields, files: files}));
    
                // convert from UTF-8 to ISO-8859-1
                var Iconv  = require('iconv').Iconv;
    
                var iconv = new Iconv('UTF-8', 'ISO-8859-1');
                var buffer = iconv.convert(stringify({fields: fields, files: 
files, latin1Symbols: '¥§©ÆÖÑøøø¼'}));
                res.write(buffer);
    
                console.log
                res.end("\n");
            });
        }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to