I have some binary data that had to be percent encoded to transfer to a remote service via a length-restricted query string parameter.
When it comes back to me some of the values are encoded like this:
\u2014
I wish to convert this value back to binary data. The Unicode character is the same as the original value in extended ASCII.
How can I convert the above back to extended ASCII?
Edit: Windows-1252
I would prefer a Javascript solution but can work with: PHP, Python, C, C++.
Here’s the mapping:
I don’t know how you mean to represent binary in js, but I am using normal array and pushing the windows-1252
byte values there as integers.