I created a function to encrypt and decrypt messages. the encrypting works fine. but when I try to log encrypted Hello World! it just logs H. Fixed it, i edited the encoding system to place a – between chars and the decoding system to just split the message at – and check if the element starts wit…
Tag: encoding
How to type text in Russian from clipboard using applescript without changing the system language on the Mac?
I automate the filling of forms in Latin alphabet, but in one place there is a field where i need to type the text in Russian. Before filling in, I copy the desired word in Russian and I want to type it from the clipboard without changing system language / encoding / charset. In other words. Just type a word
Converting from a Uint8Array to a string and back
I’m having an issue converting from a particular Uint8Array to a string and back. I’m working in the browser and in Chrome which natively supports the TextEncoder/TextDecoder modules. If I start with a simple case, everything seems to work well: const uintArray = new TextEncoder().encode(‘si…
Why are atob and btoa not reversible
I’m trying to find a simple way to record and temporarily obfuscate answers to “quiz” questions I’m writing in Markdown. (I’ll tell the students the quiz answers during the presentation, so I’m not looking for any kind of secure encryption.) I thought I could use atob(̵…
Using Javascript’s atob to decode base64 doesn’t properly decode utf-8 strings
I’m using the Javascript window.atob() function to decode a base64-encoded string (specifically the base64-encoded content from the GitHub API). Problem is I’m getting ASCII-encoded characters back (like ⢠instead of ™). How can I properly handle the incoming base64-encoded stream so that it̵…
reading in utf-8 file (javascript XMLHttpRequest) gives bad european characters
can anyone help? I have small procedure to read in an UTF-8 file with javascript using XMLHttpRequest.. this file has european characters like miércoles sábado etc.. Notice the accents.. But when being read in .. the characters are all messed up.. I have checked the file and it is perfect.. it must be the pro…
Equivalent JavaScript functions for Python’s urllib.parse.quote() and urllib.parse.unquote()
Are there any equivalent JavaScript functions for Python’s urllib.parse.quote() and urllib.parse.unquote()? The closest I’ve come across are encodeURI()/encodeURIComponent() and escape() (and their corresponding un-encoding functions), but they don’t encode/decode the same set of special cha…