progress / JSDO

Client side TypeScript library to access Progress® Data Object Services
Other
23 stars 27 forks source link

Added Unicode encoding specifically for the browser #247

Closed joshualan closed 5 years ago

joshualan commented 5 years ago

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.

zerovian commented 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?

joshualan commented 5 years ago

@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

nicoletteschreier commented 5 years ago

is this pull request satisfactory for everyone now?

edselg commented 5 years ago

Note: The Legal team may provide an updated notice.txt file.

nicoletteschreier commented 5 years ago

thanks Edsel