If json need utf8, then the last line needs to be:
put textEncode(base64Image,"UTF-8") into encodedImageData
textEncode will convert the bas64 data (stored in livecode as 16bit characters)
to UTF8
On 4/24/2024 2:45 PM, David Bovill via use-livecode wrote:
I need to put encodeImageData into js
I need to put encodeImageData into json (which is utf-8) and then post it
to the api. I'm not sure what aspects of base64 encoding would not be utf8
compatible... seem to remember there are some quirks there to be aware of.
The python code does the decode("utf-8") step at the end - so I guess
ther
On 4/24/2024 1:43 PM, David Bovill via use-livecode wrote:
I'm trying to base64 encode an image and include it into a json file to
post to an api. The python code that accomplishes this is:
image1_data =
base64.b64encode(httpx.get(image1_url).content).decode("utf-8")
When I try to follow the lo
I'm trying to base64 encode an image and include it into a json file to
post to an api. The python code that accomplishes this is:
image1_data =
base64.b64encode(httpx.get(image1_url).content).decode("utf-8")
When I try to follow the logic in Livecode I get:
put url imageUrl into sImage
put base