Closed joshualan closed 5 years ago
Shouldn't we be trying to detect if the server has sent the appropriate header's to indicate it can work with UTF-8 first, and if not, then let it fail without encoding?
@zerovian i feel like there's no point. if it doesn't accept utf-8, special characters will fail regardless of encoding. so might as well encode it right either way.
There's also the case where the server accepts utf-8 but doesn't turn on the charset=utf-8 parameter
is this pull request satisfactory for everyone now?
Note: The Legal team may provide an updated notice.txt file.
thanks Edsel
In the previous PR, I added proper encoding (and removed the base-64 pkg) for BASIC Authorization headers so that special characters (like é could be handled correctly). This change was for node/nativescript environments.
Browsers could potentially have different behaviour. I deemed that it'd be okay not to solve it (since most people use the JSDO as a npm package and not really run it on the browser anymore) but I added a fix to make sure browsers also properly encode Unicode strings.