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 with c n or
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(‘silly face demons’); // Uint8Array(17) [115, 105, 108, 108, 121, 32, 102, 97, 99, 101, 32,
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(‘message I want to obfuscate’) then tell students they can use btoa() in their developer
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’s decoded as utf-8? Answer The Unicode Problem Though JavaScript (ECMAScript) has matured, the fragility of Base64, ASCII,
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 procedure for reading in.. heres an
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 characters as far as I can tell. Answer OK, I think I’m going to go with a hybrid custom set of functions: Encode: Use encodeURIComponent(), then