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
1
vote
2 answers

Decode JSON key in PHP with special characters

This should be a simple issue, but I can't seem to get the past the syntax. object(stdClass)#15 (12) { ["im:name"]=> object(stdClass)#14 (1) { ["label"]=> string(15) "Balls VS Blocks" } A simple $info->im:name->label should be…
Chad
  • 643
  • 2
  • 11
  • 22
1
vote
0 answers

How to decode an HTTP request with utf-8 and treat the surrogate keys (Emojis)

I'm having a hard time dealing with some parsing issues related to Emojis. I have a json requested through the brandwatch site using urllib.(1) Then, I must decode it in utf-8, however, when I do so, I'm getting surrogate keys and the json.loader…
PhaSath
  • 166
  • 1
  • 12
1
vote
0 answers

Why is the Python Socket connected to ser2net returneing garbled characters?

I am using ser2net on raspberry pi to make a tcp/serial bridge. When I connect to the raspberry pi using python socket tcp protocol, all I recieve is something like…
Desmond Chen
  • 492
  • 5
  • 17
1
vote
2 answers

Convert JWT token created by Java JWT in python

I have received a JWT token created by a java program using jjwt module. Now, when I try to verify the token using pyjwt, it throws exception. import jwt…
Palaz
  • 13
  • 1
  • 4
1
vote
2 answers

Retrieving JSON data in PHP (having 'Undefined Property' error)

I want to get data from API but instead keep getting 'Undefined Property' PHP error. I am trying to get 'SESSION_ID' in Datas in Data. (JSON/POST) { "Data": { "Code":"00", "Datas": { "COM_CODE":"80001", …
Dahn Hwang
  • 45
  • 8
1
vote
1 answer

CanBus Shield seeedStudio not capturing data

I have purchased a Seeed Studio Can Bus Shield V1.2 and I’m having problems listening to a bus at 200kbps but I had success listing to my car's bus. I have an undocumented bus running at 200kps (it’ not a car bus) that I need to sniff, there are 3…
Nathalie
  • 625
  • 6
  • 19
1
vote
2 answers

PHP problem decoding GET parameter with double quotes

I'm passing a 'data' parameter to a php page using AJAX. The parameter is a JSON string like: {"type":"value"} I encode with encodeURIComponent JS function getting: %7B%22type%22%3A%22value%22%7D If I write by…
neil
  • 11
  • 2
1
vote
4 answers

Struts 2.0.14 GET parametrs are not URLDecoded, is that a bug?

I've got a problem with the parameters passed in the url. Let say the request is: /struts/MyAction.action?param=foo%40bar.com The action field gets the "param" field set to "foo%40bar.com", is that a bug or I am expecting too much from Struts? My…
Chris Ciesielski
  • 1,203
  • 2
  • 10
  • 19
1
vote
2 answers

How to decode registry value using winreg

I have this code from winreg import * aReg=ConnectRegistry(None, HKEY_CURRENT_USER) aKey=OpenKey(aReg, 'Software\Microsoft\Windows\CurrentVersion\Explorer\Accent') aKey=EnumValue(aKey, 0) print(aKey[1]) And when I run it, it returns this…
Jakub Bláha
  • 1,491
  • 5
  • 22
  • 43
1
vote
6 answers

How to decode (shifting and xoring) a massive byte array in a fast way?

How to decode (shifting and xoring) a massive byte array in a fast way? I need it for a file viewer application that opens the archive file and decodes the files inside and display them to the user. The files are encrypted with a byte shifting and…
lesderid
  • 3,388
  • 8
  • 39
  • 65
1
vote
1 answer

How to convert Data with 32 bytes to string with 32 char length in iOS Swift 3.1?

I have String with 44 char length and i want to convert it to 32 char length in iOS Swift 3.1 let keyString = "u6KuXJLIUwEUl7noY8J8H1ffDRwLC/5gjaWW1qTQ3hE=" i use this code for convert it to Data with 32 bytes : let keyData =…
reza_khalafi
  • 6,230
  • 7
  • 56
  • 82
1
vote
2 answers

Json empty array json_decode

I have the following code that converts json into an array: $str = file_get_contents('http://localhost/data.json'); $decodedstr = html_entity_decode($str); $jarray = json_decode($decodedstr, true); echo "
";
print_r($jarray);
echo…
FutureCake
  • 2,614
  • 3
  • 27
  • 70
1
vote
0 answers

json_decode empty array because of SyntaxError

I have the following Json file: {   "id": "04d925a8-c62a-4c28-83eb-21bfb879583a",   "timestamp": "2017-05-07T10:23:05.165Z",   "lang": "en",   "result": {     "source": "agent",     "resolvedQuery": "fever",     "action":…
FutureCake
  • 2,614
  • 3
  • 27
  • 70
1
vote
0 answers

Reading the information in an unknown data file type

I have a data file that has been generated by an application as an output of results to some tests. I would like to be able to read the information contained in the file but it is encoded in a format which I presume to be some kind of binary. Is…
Nick
  • 11
  • 2
1
vote
2 answers

Twig: add json_decode as a filter

I'm trying to decode a JSON string in my twig file. Of course I've done some research and I've found this earlier question on StackOverflow: here. They give a method to decode JSON in twig, but I don't really understand the way I should do it. They…
user5753352