decoding

How to reverse the process of this C# Decode method to create an Encode method?

I would like to know how to reverse the process of the below DecodeBinaryBase64 so that I can have a matching Encode method. In short C# code that if given the output of this method it would return the same string that it took as input. private static string DecodeBinaryBase64(string stringToDecode) { StringBuilder builder = new S...

Python encoding function can't be decoded

I wrote this python code in an attempt to convert objects to a string of ones and zeros, but the decoding fails because the data can't be unpickled. This is the code: def encode(obj): 'convert an object to ones and zeros' def tobin(str): rstr = '' for f in str: if f == "0": rstr += "0000" ...

Decoding Audio / Audio Playback (AS3)

I'm interested in learning how to decode and playback audio in ActionScript 3. I understand how to write bytes to a Sound object using the SAMPLE_DATA event, so that's not really a problem. What I want to understand is how I could implement alternate audio formats for native playback inside of Flash Player. I guess what I'm asking is: ...

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 : <a> becomes &lt;a&gt; The server behavior cannot be changed. If I could change it, I would! Is there a way I can encode my HTML chun...

boost::iostreams::zlib::default_noheader seems to be ignored.

Hi stackoverflow, I'm having trouble getting boost::iostreams's zlib filter to ignore gzip headers ... It seems that setting zlib_param's default_noheader to true and then calling zlib_decompressor() produces the 'data_error' error (incorrect header check). This tells me zlib is still expecting to find headers. Has anyone gotten boost::...

How to decode eval(stripslashes(gzinflate ...

Hello, I've decoded code in footer and header of template, but don't know how to do it in functions.php in wordpress template. Can you please decode this code: <?php print(stripslashes(gzinflate(base64_decode("VZBNS8QwEIbvC/0PcyikhbJ611rY9QPZxZOKSKCUyYSETZOSpB4U/7uztCLCHGbeZ767m+sO9Owx2+ABDeGpNzQoilX9VWwAoHStFE+7l9cd7t/swd0e3h+OUlwtUL...

How to get YCbCr or RGB from FLV video "Tag" using FFmpeg?

So I have some uint8_t buf or FILE buf with FLV Video tag. We know its a video tag but we do not know in what codeck it is. We know its with a Key frame. How using FFmpeg C librarys to decode that encoded frame into RGB or YCbCr? ...

How to stop automatic url decode in Firefox & Safari?

in my web application i want to transmit some values through the url between pages. Because i have some special characters i decided to encode my values in order not to break my urls. in IE and Opera when i load my urls in a browser they stay encoded but in Safari and Firefox the urls are automatically decoded and my code breaks. in IE8...

Decode some injected Javascript?

I had the following injected into the footer of a site of mine and, in an effort of solving the greater mystery ("How" it happened), I'm trying to decode it. Any ideas? Here's the code: <ads><script type="text/javascript">document.write(unescape('%3C%73%63%72%69%70%74%20%6C%61%6E%67%75%61%67%65%3D%22%6A%61%76%61%73%63%72%69%70%74%22%20...

PHP URL Encoding/Decoding Pretty Quotes across form field's %u2019

For some reason, after submitting a string like this Jack’s Spindle from a text form to php, I get: Jack%u2019s Spindle This is not what PHP's urlencode() would do, which would be Jack%92s+Spindle or rawurlencode() = Jack%92s%20Spindle Thus, urldecode() and the raw version don't work to decode that string... Is there another function ...

How to code number in string and later decode it ?

I'm looking for encrypt/decrypt functions that will encode numbers (0, 1, 2, ...) into strings, such that these strings will look random, and later the number could be decodes back from the string. For example: 3 will be encrypted to ABFQWEMasdEE, and 6 will be encrypted to poad_Asd#@sad. If I could control the number of characters in ...

What encoding format is this?

I'm trying to edit a (slightly) proprietary format and within one of the files it will encode a connection string. I have a way to encode my own data with it, so I can reverse engineer it a bit. ABC123"/3 will encode to rijcmlqXxEeLA4tSspHg5XfWJiq4w== and AB120";2 encodes to rijcmlqiF3LjnFJnYfEi2WvcSoPSg== Is this a know...

=?ISO-8859-1 in mail subject

I'm acquiring the unread mails I have in my GMail account through PHP and its method *imap_open* When I get the subjects through the method *imap_fetch_overview* I get some subjects like this: =?ISO-8859-1?Q?Informaci=F3n_Apartamento_a_la_Venta?= =?ISO-8859-1?Q?_en_Benasque(Demandas:_0442_______)?= It's unreadable, I think because of...

Is there a way to decode q-encoded strings in Ruby?

I'm working with mails, and names and subjects sometimes come q-encoded, like this: =?UTF-8?Q?J=2E_Pablo_Fern=C3=A1ndez?= Is there a way to decode them in Ruby? It seems TMail should take care of it, but it's not doing it. ...

Working with HTML econding in PHP (intelligent way to decode)

Hi guys, from a PHP script I'm downloading a RSS feed like: $fp = fopen('http://news.google.es/news?cf=all&amp;ned=es_ve&amp;hl=es&amp;output=rss','r') or die('Error reading RSS data.'); The feed is an spanish news feed, after I downloaded the file I parsed all the info into one var that have only the content of the tag <descriptio...

exracting frames from custom video format

Hi, I have a mp4 video which needs a .ax codec to be installed for it to play. I am trying to extract frames from the video. ffmpeg does not seem to work and i suspect it is because of the need for the codec to play the file. Is it possible for me to somehow extract the frames using some software which would probably take the ax files a...

zxing how to decode from a file?

Hello all, 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 HybridBinarizer is not known....

Decoding sniffed packets

I understand that each packet has some header that seems like a random mix of chars. On the other hand, the content itself can be in pure ascii and therefore it might be human friendly. Some of the packets I sniffed were readable (raw html headers for sure). But some packets looked like this: 0000 00 15 af 51 68 b2 00 e0 98 be cf d6 0...

URLEncoder and URLDecoder encode and decode Javadoc Note: What if UTF-8 is not used?

So, the javadoc for URLEncoder's encode and URLDecoder's decode have this note in them: Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites." However, if someone sends in a request with a different encoding type, wouldn't it be a bad idea to encode with UTF-...

Escape brackets on php for javascript

For example i've a php script with this content: <?php $msg = addslashes("I'm a message. The what happened >:("); echo "<script>alert($msg); return false;</script>"; ?> But the alert get broken by the last "(". How can i solve this? ...