Questions tagged [decoding]

5

votes
0

answer
90

Views

How to decode Data (ie block state) bytes in Minecraft schematic (nbt) file?

I am parsing a schematic file with the following structure The .schematic file format was created by the community to store sections of a Minecraft world for use with third-party programs. Schematics are in NBT format The Named Binary Tag (NBT) file format is an extremely simple structured binary f...
lancew
1

votes
2

answer
36

Views

What are these symbols that crash URLDecoder with UTF-8?

I'm using URLDecoder to decode a string: import java.net.URLDecoder; URLDecoder.decode('%u6EDA%u52A8%u8F74%u627F', StandardCharsets.UTF_8.name()); Which leads to the crash Exception in thread 'main' java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For in...
Sahand
1

votes
0

answer
91

Views

Python - Decode Text (German) from Hexadecimal Value and write it to a file

I know there are a lot of encoding/decoding topics here and I tried it for hours, but I'm still not able to solve it. Hence I want to raise a question: I have a string with hexadecimal values, which in the end is a text that I want to write to a text file with the correct encoding. hexvalues = '4765...
Ginsor
1

votes
1

answer
206

Views

swift4 encoding decoding for model class of nested json parsing

I have a model class of swift which was created based on a nested json response, it follows like below struct RootClass : Codable { let details : String? let itemCount : Int? let list : [List]? enum CodingKeys: String, CodingKey { case details = 'Details' case itemCount = 'ItemCount' case list = 'Li...
stack qstns
1

votes
1

answer
450

Views

C# GIF encoder/decoder

I’m working on a program that loads a animated GIF file and alter some of the pixels, then spits it back out as a new animated GIF file. The outputted GIF animates just fine in Windows, browsers and Photoshop. However, if I try to load the GIF with my program, it will not animated. Also, I cannot...
user1753782
1

votes
2

answer
321

Views

Is this a valid byte string for AES Key?

I am working on a little sideproject in Python 3. My current problem is around AES-based decryption of a file. The content of the file (text) is symmetrical encrypted with AES. I have imported PyCrypto: https://www.dlitz.net/software/pycrypto/api/current/ The docs specificy only little regarding the...
AFX
1

votes
0

answer
117

Views

Android: Decoding an encoded LatLngList with PolyUtil.decode causes StringIndexOutOfBoundsException

I've an Android application which loads routes from the database. These routes are encoded lists of LatLng objects. I am using the PolyUtil library for encoding and decoding of the list of LatLng objects: final String encodedLatLngList = PolyUtil.encode(recordedLatLngList); and List decodedLatLngLi...
Kaan Apaydın
1

votes
0

answer
43

Views

QuotedPrintableCodec doesn't works

I still have problems with decode a string that type is Quoted Printable. Now, I'm using the QuotedPrintableCodec class, but the problem continues. I have a method: public static String decodeString(String str){ try { return new String(QuotedPrintableCodec.decodeQuotedPrintable(str.getBytes('ISO_885...
laaf
1

votes
0

answer
119

Views

Error occurs while gettting video feed from IP Camera (OpenCV python 3.3)

I am trying get video from IP Camera (rtsp protocol) but sometimes these errors come. [h264 @ 0x509b300] cabac decode of qscale diff failed at 16 28 [h264 @ 0x509b300] error while decoding MB 16 28, bytestream 3648 TypeError: int() argument must be a string, a bytes-like object or a number, not 'Non...
1

votes
0

answer
118

Views

How does QR-code work?

Can you please explain me How actually QR codes are created and How they are decoded. There are lots of websites and apps that can do the job. Here I have created a QR-code for the character QR12 by the website and this gives the following code : I have decoded it to verify with the website and this...
Primo Raj
1

votes
2

answer
483

Views

Raw String to normal string javascript

Normal String assignment: var str1 = '\320'; console.log(str1); // 'Ð' Raw String assignment: var str2 = String.raw`\320`; console.log(str2); // '\320' In raw string, the backslashes are not interpreted. I need to interpret them so that '\320' will become 'Ð'. Should I have to convert th...
Dhamo R
1

votes
0

answer
44

Views

Decode Bytes from Server and then Render it on SurfaceView or some Player using Mediacodec

I am developing an app in which I am sending the video/audio encoded bytes from Server using MediaCodec to receiver via socket on same network. At Receiver end, I am successfully fetching bytes. Now, I want to decode these bytes using MediaCodec and show them on SurfaceView or Some player. Below is...
Ankit
1

votes
1

answer
186

Views

swift 4 xcode app not reading in json file

So I have a paging app with 3 pages and each page has a details view. All three pages (views) access separate json data files. Everything worked fine until I set up the third page view and its detail view. Now the app can't seem to access the json file for the second view. It gets the path to the fi...
chasahodge
1

votes
1

answer
84

Views

I was wondering if someone could explain to me .decode and .encode in hashlib?

I understand that you have a hex string and perform SHA256 on it twice and then byte-swap the final hex string. The goal of this code is to find a Merkle Root by concatenating two transactions. I would like to understand what's going on in the background a bit more. What exactly are you decoding and...
Ben Stolman
1

votes
0

answer
638

Views

How to decode a PDF file to a readable format?

I want to decode a PDF file so I can use/edit the elements inside the pdf, I want to use/edit them in Lua so I have to have the readable format. This is the format I need. %PDF-1.3 ... > stream 2 J 0.57 w BT /F1 16.00 Tf ET BT 31.19 794.57 Td (Hello World!) Tj ET endstream endobj 1 0 obj
JManKorl
1

votes
1

answer
63

Views

Reedsolomon Polynomial Coeffs Decoding Returning Empty Bytearray

I'm trying out an algorithm for cryptolology. The process should have been simple: It secures a message msg = b'Sample' by passing IPI points, let's say: ipi = np.array([1,2,3,4,5]) Via RSCodec by encoding the message a polynomial coefficient is generated. And by passing IPI points through the poly...
deku
1

votes
0

answer
125

Views

How to decode prefix codes efficiently with Python?

I am trying to decode a Huffman encoded string, with the following script: def decode(input_string, lookup_table): codes = lookup_table.keys() result = bytearray() i = 0 while len(input_string[i:]) != 0: for code in codes: if input_string[i:].startswith(code): result.append(lookup_table[code]) i +=...
Pim Klaassen
1

votes
1

answer
248

Views

How to decode celery message in SQS

Some of celery tasks in sqs are pending forever, I want to read those messages (tasks) before deleting. On going to sqs console, I am able to see the encoded message I tried decoding it with value = base64.b64decode(value.encode('utf-8')).decode('utf-8') This gives me dict dump with keys ['body', '...
Dheeraj Pande
1

votes
0

answer
48

Views

How to read back JPG with multiple data created in Unity? ( C# )

I'm really sorry if this has been asked before, or if it is obvious, but I'm not entirely sure how to progress here. Please excuse the length of the question. For a research project, my intention is to create a JPG image that contains after the JPG data a small plain text and another image as well....
1

votes
2

answer
206

Views

Swift - Simple fix for “Instance member cannot be used on type” error?

Here is the JSON 'decoding'/parsing I did based on the isSteamDown JSON page: struct Instruction: Decodable { let statuses: [Status] let message, messageURL: String let status: Bool let load, time: Int enum CodingKeys: String, CodingKey { case statuses, message case messageURL = 'message_url' case s...
bluewizard3
1

votes
1

answer
117

Views

Decoding timestamp encoded in ASN.1 (javascript)

I am trying to decode the timestamp which I am receiving from my HTTP post request, but this is a really complex task, I do not even have any proper insight into ASN.1/RFC 3161 so if anyone out there is willing to help me out, I would really be stoked! Code: import { Action } from 'kawax-js'; import...
Lovro Bilješković
1

votes
1

answer
163

Views

How can I make an array of frequencies accurately depict a decoded mp3 file?

I am using mp3spi and Triton, and this code will handle exclusively 192kbps mp3 files. The problem I am facing is that the first second of hz is mostly made up of exclusively: 0,0,0,0 or 255,255,255,255 I do believe I might not be skipping the header correct, in which case the frequencies are not a...
Johnsen.Martin
1

votes
0

answer
33

Views

Php websocket why ord in frame decoding?

I'm trying to understand Websockets protocol and I'm stuck in frame decoding part. In every PHP example I saw, I saw the use of the 'ord' function and when I'm looking at the doc (in French actually), it says that it returns the ASCII value of a character. But when I'm looking at the RFC6455 (Payloa...
MrDeliK
1

votes
0

answer
49

Views

Opensource TCAP/MAP C/C++ implementation

I am looking for C/C++ implementation for encoding and decoding of TCAP/MAP layers. I am already aware of osmocom. I would like to know whether there exists any other reliable opensource tool for this goal?
mohtemp
1

votes
1

answer
35

Views

Error while decoding base64 string to UIImage

I am trying to decode base64 String to UIImage in Swift 4.2. I have tried almost every solution on stackoverflow but it's not working. I have tried converting the string with NSData, it didn't work. Now I am converting the string to Data and afterwards to image but it's giving this error. (Type of e...
Hashir Saeed
1

votes
0

answer
40

Views

How to encode an object that contains an attributed string to Data?

I have an NSDocument subclass that contains a property of type NSAttributedString (among others). In order to enable persistence I need to override the following two methods: override func data(ofType typeName: String) throws -> Data { // Insert code here to write your document to data of the specif...
Mischa
1

votes
2

answer
619

Views

Decoding a GIF question

For a personal project I'm creating a static gif decoder. Everything works well so far, except I'm having trouble understanding one concept from the specification: This block is REQUIRED for an image. Exactly one Image Descriptor must be present per image in the Data Stream. An unlimited number of...
Martin Konecny
1

votes
1

answer
1.3k

Views

Unable to decode hex values in javascript tooltip

I have quite the process that we go through in order to display some e-mail communications in our application. Trying to keep it as general as possible... -We make a request to a service via XML -Get the XML reply string, send the string to a method to encode any invalid characters as follows: publ...
user368432
1

votes
1

answer
138

Views

How to unproperly encode my HTML chunk so it is displayed properly in my page

I need to retrieve some HTML tags from a database to display in my page. But when the web server outputs the query result (a small html chunk), it encodes the HTML before outputing on the page. Example : becomes <a> The server behavior cannot be changed. If I could change it, I would! Is there a wa...
Philippe
1

votes
1

answer
607

Views

zxing how to decode from a file?

I am developing an application based on the zxing library and I would like the user to be able to decode a photo that is stored on the sd card. I have found an example under the androidTest example but when I tried to use it I found that in class BenchmarkThread in line 96 eclipse complained that Hy...
maxsap
1

votes
1

answer
414

Views

iPhone: Decode characters like \U05de

I used SBJsonParser to parse a json string. inside, instead of hebrew chars, I got a string full of chars in a form like \U05de what would be the best way to decode these back to hebrew chars, so i can put these on controls like UIFieldView?
Alon Amir
1

votes
5

answer
1.7k

Views

Get UTF8 strings from remote DB

My application downloads some data from remote MySQL database. Problem is that db stores strings as utf8. But data I receive is ascii decoded. How to get around this ? The code : cursor = conn.cursor() query = '''MY QUERY HERE''' cursor.execute(query) result = cursor.fetchall()
DevAno1
1

votes
1

answer
2.1k

Views

How to do “decode 'unicode-escape'” only on \xhh characters in a string in Perl?

I have a file with the following content with some characters are UTF-8 hex encoded in the string literal: \'Hello W\xC3\x96rld\' I want to read the file and decode the UTF-8 hex encoded characters in the file to the actual unicode characters they represent and then write to a new file. Given the a...
His
1

votes
1

answer
1.1k

Views

How to use unescape() function inside JavaScript?

I have a JSP page in which I have JavaScript function that will be called when a link is clicked. Now, when the value reaches the JavaScript function, the apostrophe is encoded. Example: Name#039;s Before # there is &, which originally should be: Name's I have used the unescape() decode function,...
Anshu Kunal
1

votes
1

answer
1.4k

Views

appengine base64 encoded string is different from my local machine's

This is the code: >>> import base64 >>> id = 1 >>> key = 'secret key very long' >>> enc = base64.urlsafe_b64encode(str(id)+key) >>> enc 'MXNlY3JldCBrZXkgdmVyeSBsb25n' >>> base64.urlsafe_b64decode(enc) '1secret key very long' Works as intended on my machine, but when I upload this code to google appe...
1

votes
5

answer
4.6k

Views

Decoding Quoted printable message

Iam having trouble decoding Japanese message, the final output seems to be a garbage value. Encoded ISO-2022-JP Quoted Printable Message: '=82=B1=82=EA=82=CD=92P=82=C8=82=E9=83e=83X=83g=82=C5=82=B7=82=DD=82=C8=82=B3=\r\n=82=F1=81A=82=B1 =82=F1=82=C9=82=BF=82=CD' Code for decoding Quoted Printable...
user845405
1

votes
1

answer
770

Views

draw graph of encoded bit rate of video vs play location

I am trying to measure the variation in the bandwidth required when a video is played over the network. For this purpose, i need to make a graph of the bandwidth required to play the video continuously at any time during the video. I tried processing the video with gstreamer but it gives me the bit...
ConfusedAboutCPP
1

votes
1

answer
2k

Views

FFMPEG audio decoding

I have used the avcodec_decode_audio3 function to decode the AMR content in the frame order. I get 640 bytes output for each frame, with sample format being float and I have saved the output as a raw output file. Now, I want to validate this output content. But I can't play it in any player as it do...
NitinG
1

votes
1

answer
392

Views

Converting ASCII strings into numbers

For an arbitrary precision integer class i wrote, I have a constructor that accepts a string containing the integer's value and an uint16_t to say what base the string is in. integer('123', 10) -> 0x7b -> 123 base 10 integer('ab', 256) -> 0x6162 -> 24930 base 10 Since my class can accept negati...
calccrypto
1

votes
2

answer
813

Views

Mixed Encoding to String

I have a string in VB.net that may contain something like the following: This is a 0x000020AC symbol This is the UTF-32 encoding for the Euro Symbol according to this article http://www.fileformat.info/info/unicode/char/20ac/index.htm I'd like to convert this into This is a € symbol I've tried usi...
Elarys

View additional questions