I already read a lot of questions but none is solution for my problem.
I'm trying to submit a form where the charset of the page is ISO-8859-1. I'm using github.com/request/request.
From documentation, to submit a form we basically need to:
request.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ })
I try it but the ascii characters wasn't right. The page doesn't accept what I'm sending:
var options = {
url: formData.action,
encoding: 'ascii',
form: { username: 'teste', password: '23dçkasã' }
}
request.post(options, function...)
I try also:
var options = {
url: formData.action,
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=iso-8859-1'
},
form: { username: 'teste', password: '23dçkasã' }
}
request.post(options, function...)
EDIT:
I try also with charset=Windows-1252
and with Iconv: var iconv = new Iconv('UTF-8', 'ISO-8859-1');