Questions tagged [decode]

To convert some encoded data (e.g. bytes, electrical signals) to some representation ready for further processing (e.g. string, object, picture)

4353 questions
16
votes
3 answers

Decode JSON into Elm Maybe

Given the following JSON: [ { "id": 0, "name": "Item 1", "desc": "The first item" }, { "id": 1, "name": "Item 2" } ] How do you decode that into the following Model: type alias Model = { id : Int , name : String …
Matthew Rankin
  • 457,139
  • 39
  • 126
  • 163
16
votes
5 answers

PHP7.1 mcrypt alternative

Mcrypt function has been deprecated as of PHP 7.1.0. My deprecated string encode / decode functions: $key: secret key $str: string $encoded = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $str, MCRYPT_MODE_CBC,…
Tibi
  • 163
  • 1
  • 1
  • 6
16
votes
3 answers

Disable decoding of HTML entities in Chrome developer tools

I am working in Chrome developer tools and looking for a way to show HTML entities by default. The view I see is this: Whereas, the view I need is this: Does anybody know how I can enable the view I need? I know there is a theme engine for…
16
votes
2 answers

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128)

I'm simply trying to decode \uXXXX\uXXXX\uXXXX-like string. But I get an error: $ python Python 2.7.6 (default, Sep 9 2014, 15:04:36) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license"…
Serhii Matrunchyk
  • 9,083
  • 6
  • 34
  • 47
16
votes
3 answers

How to downsample images correctly?

Background Creating an app that has a lot of high quality images, I've decided to downscale the images to the needed size (meaning that if the image is larger than the screen , I downscale it ) . The problem I've noticed that on some devices, if the…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
16
votes
2 answers

Decoding Video using FFMpeg for android

I tried to decode video using FFMpeg library from the sample examples available on internet, i figure it out with new version of ffmpeg, here is the code which I called from my class file, private static native int decodeVideo(String filename); …
Rahul Upadhyay
  • 3,493
  • 2
  • 21
  • 37
15
votes
6 answers

Python - Converting Hex to INT/CHAR

I am having some difficulty changing a hex to an int/char (char preferably). Via the website; http://home2.paulschou.net/tools/xlate/ I enter the hex of C0A80026 into the hex box, in the DEC / CHAR box it correctly outputs the IP I expected it to…
Draineh
  • 599
  • 3
  • 11
  • 28
15
votes
2 answers

How do I get hex blocks from a base 64 encoded string?

In this article and this XKCD, they both show the password data as groupings of hexadecimal. However, in the file it's base64 encoded. What could I use to match that output with bash scripting? I've tried: echo -n "7WkoOEfwfTTioxG6CatHBw==" | base64…
Ehryk
  • 1,930
  • 2
  • 27
  • 47
14
votes
4 answers

EAN128 or GS1-128 decode c#

Here is the sample of EAN128 or new name GS1-128 barcode 01088888931021461712031510W1040190 I want to decode it to ais (01)08888893102146 (17)120315 (10)W1040190 But the barcode can be changed like this 1712031510W1040190 (17)120315 …
Murat Vezir
  • 216
  • 1
  • 3
  • 12
14
votes
1 answer

How to recreate the preview from Instagram's media_preview raw data?

If you get JSON data from Instagram's API you will find a media_preview key, the value of which is some Base64-encoded data. It really looks like some very small preview binary data. Maybe compressed. Take this post for example. It's just a black…
Alexander C
  • 3,597
  • 1
  • 23
  • 39
14
votes
2 answers

decodeURI decodes space as + symbol

I have created a Google Custom Search. The logic is when a user search, the page will display result and the title of the page will be changed to the search term using javascript. I use decodeURI to decode the unicode characters. But the space is…
user2435840
  • 143
  • 1
  • 1
  • 5
14
votes
1 answer

How can I perform hardware-accelerated H.264 encoding and decoding for streaming?

I am able to get the RGBA frame data from the camera, and I want to encode it in H.264 format. I've used FFmpeg to encode and decode H.264 video, but at a frame size of 640x480 it's too slow for my needs. I'd like to use hardware acceleration to…
king
  • 169
  • 1
  • 1
  • 7
13
votes
1 answer

Convert formatted HTML text string to NSString parts

I want to decode HTML string and store it in NSString. following is the html string for one of the response from google direction api. teststring is Turn right onto Kennington Park Rd/A3
Continue to follow…
chatur
  • 2,365
  • 4
  • 24
  • 38
13
votes
1 answer

AWS CloudWatch log subscription filters decode

I am using CloudWatch log subscription filters stream to Lambda and publish a message to an SNS topic. But it will output garbled message and can't success decode. my output: k %" jVbB If not decode will output like this: { "awslogs": {"data":…
13
votes
3 answers

CloudWatch logs stream to Lambda python

I have created a subscription filter in CloudWatch log group and made it stream to my lambda function, but am getting an error in my lambda function. Code: import boto3 import binascii import json import base64 import zlib def…
Abdul Salam
  • 522
  • 2
  • 7
  • 26